views:

330

answers:

1

Can someone point me in the direction of how to implement an "autocomplete" search interface on the iPhone. I am assuming I will need to use a NSTimer to periodically check what has been typed and then submit that partial string to my data source and then display those.

I need to connect it up with an existing web service returning JSON

A tutorial or some sample code would be preferred.

thanks

+1  A: 

This Stack Overflow answer will likely help you. If you are using a UISearchDisplayController, you would not need to use an NSTimer to poll the search field, as changes to the search field will fire delegate methods for you.

In those delegate methods, you may apply a new search predicate based on the contents of the field, and then refresh the data fetch and display possible words.

Alex Reynolds