I am using UISearchDisplayController to pull in results from a webservice but I want to be able to search even if the search bar's text is empty. It seems like results are only be开发者_如何学Pythoning pulled in if this is not empty. How do I update & show the results tableview by only scope?
Use the - (void)searchDisplayControllerDidBeginSearch:(UISearchDisplayController *)controller UISearchDisplayControllerDelegate to search and then reload the searchResultsTableView (UISearchDisplayController)
For that you can put the condition when the scope button is changed
if([searchBar.text length])
{
//CALL FOR QUERY ACCORDING TO TEXT IN SEARCHBOX
}
else
{
//CALL THE QUERY AS PER CHANGE IN SCOPE
}
精彩评论