Antol / APAutocompleteTextField

Autocomplete text field. It works like Safari (iOS) or Chrome (iOS) search / address bar
MIT License
79 stars 9 forks source link

A little bug #1

Closed Nikaladze closed 10 years ago

Nikaladze commented 10 years ago

There is a little bug when I trying to type first letter from the phrase. For example, if my first character will be 'a' - there will be:

APAutocompleteTextFieldExample[1487:70b] 
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', 
reason: 'Wrong completion string'

So, I have modified your code (just a little) by adding one condition to autocompleteTextField:complitedStringForOriginString in APViewController.m:

if ((originStringRange.location == NSNotFound) || (originStringRange.location != 0) ) {
        complitedString = nil;
    }
Antol commented 10 years ago

Oh. Yes, of course. I missed it. But this is just an example, so that's okay. I'll fix it, thanks