Reputation: 44455
I want to store about 10000 strings in my iOS app. I want the ability to quickly search these strings (similar to searching on the devices themselves when you swipe to the left of the home screen). Searching should include a form of "suggest" or auto-complete. For example typing "food" into the search box should bring up a list containing "food stores" "food recipes" etc.
How can I implement this type of search? Perhaps a sqlLite database and ... ?
Cheers!
Upvotes: 0
Views: 484
Reputation: 5694
Depends on a case you can follow two ways:
Integrate Core Data as Diederik Hoogenboom suggested.
Use filteredArrayUsingPredicate method of NSArray and build a predicate for your needs as described in following document Predicate Programming Guide
I am personally prefer option #2, it is easier to start and depends on solution's performance and memory footprint you can always switch to more complex #1 option.
Upvotes: 1