0
我有2个UITableView与UISearchDisplayController在同一个UIView。 如何确定两个UITableView中的哪一个与UISearchDisplay控制器相关?UISearchDisplayController和相关的搜索结果tableview
欢迎任何评论
我有2个UITableView与UISearchDisplayController在同一个UIView。 如何确定两个UITableView中的哪一个与UISearchDisplay控制器相关?UISearchDisplayController和相关的搜索结果tableview
欢迎任何评论
您可以同时设置为searchBars和tableViews标记,并适当地检查它们在UISearchBarDisplayController和UITableView的委托的回调。
例如:
-(BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchScope:(NSInteger)searchOption
{
if (controller.searchBar.tag == 1)
{
[self.tableView1 reloadData];
return YES;
}
else if (controller.searchBar.tag == 2)
{
[self.tableView2 reloadData];
return YES;
}
return NO;
}
您可以随时使用上UIViews标签检查“谁是谁”在你的代码。
希望这会有所帮助。