开发者

Search UISearchDisplayController w/ Scope Only

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
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜