I am implementing a UISearchDisplayController
and I would like to populate the searchResultsTableView
with the content of the tableView (unfiltered) right on load - before text is being entered.
This works when I start entering values in the searchBar.
- (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller {
self.isSearching = YES;
//tell the searchDisplayTableView to show here!
[controller.searchBar setShowsCancelButton:YES animated:YES];
}
- (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller {
self.isSearching = NO;
[controller.searchBar setShowsCancelButton:NO animated:YES];
}
Would anybody have any pointers into the right direction?
Please don't reply with "don't do that" or "Apple did not design the control that way." or ...
Apple's control works like that. I solved it by implementing a separate controller (call it search display controller) object that is a search bar delegate and applies a predicate to the datasource. This way the tableview is filtered 'inline'.