【发布时间】:2014-02-11 17:00:56
【问题描述】:
我有一张姓名表,顶部有一个搜索栏。 I need to perform an action when one of the result rows selected, which is hide the table view and show another view.
在didSelectRowAtIndexPath 中,我正在执行以下操作:
if ([self.searchDisplayController isActive]) {
Selection = [searchResult objectAtIndex:indexPath.row];
tableView.hidden = YES;
DetailView.hidden = NO;
}
我也试过了
if(tableView == self.searchDisplayController.searchResultsTableView)
我没有另一个控制器来使用“Segue”,我的两个视图都在同一个控制器中。
【问题讨论】:
-
您确定您的委托已设置吗?你的 if 语句会被调用吗?
-
@ansible,在 if 语句中,我正在打印“Selection”字符串,这是从结果中选择的行,这意味着它会响应 if 语句。
标签: ios iphone objective-c uitableview uisearchbar