2
我有我添加以编程方式的UISearchBar这样的(这是我的viewDidLoad)一个表视图控制器:的UISearchBar时以编程方式添加不`吨调用didSelectRowAtIndexPath方法
searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 64)];
searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self];
searchDisplayController.delegate = self;
searchDisplayController.searchResultsDataSource = self;
searchBar.delegate = self;
[self.tableView.tableHeaderView addSubview:searchBar];
[self.tableView.tableHeaderView sizeToFit];
我dont`t设置为tableHeaderView因为我对标题有另一种看法(蓝色)。
问题是,当我搜索并点击单元格,方法didSelectRowAtIndexPath方法没有被调用。而且,正如它在我的图片上显示的那样,我需要知道选中的单元格是否添加了复选标记。