Here is how I did it. When the delegate
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
tells me that the user typed something in the search bar, I create a predicate
[NSPredicate predicateWithFormat:@"string CONTAINS[c] %@",searchText];
retrieve results from MOC with this predicate, update my result array and report viewing the result table to reload
[[self.searchDisplayController searchResultsTableView] reloadData];
If you have many results, you can try to set a sampling limit and load all results if the user clicks the search button.
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar;
Hope this helps.
source
share