I have a very simple Core Data app which pretty much contains strings of text. I would like to make this text searchable, and can see a “Search Bar and Search Display Controller” object in Interface Builder.
Firstly, would using this Search Bar and Search Display Controller be the best approach for a simple Core Data-driven text search? Secondly, could you point me to some resources which would get me started? Possibly a nice step by step guide or a sample project – the simpler the better.
I have looked both on SO and the Apple iPhone Dev Center but I can’t seem to find anything. Thanks again!
This is how I did it.
When the delegate
tells me the user typed something in the search bar, I create a predicate
fetch the results from the MOC with this predicate, update my results array and tell the results table view to reload
If you have a lot a results you can try setting a fetch limit, and load all the results if the user presses the search button.
Hope this helps.