I have a UIViewController
with a UISearchDisplayController
in it. I have it showing the search results tableview, but clicking any cells never fires didSelectRowAtIndexPath:
#pragma mark - UITableViewDelegate
-(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"did select row");
}
I've seen these relevant questions:
but I'm not making the same mistake. The view controller implements UITableViewDelegate
and UISearchDisplayDelegate
. The UISearchDisplayController
delegate and searchResultDelegate are hooked up to the view controller in the storyboard. But just to be sure I did the following in viewDidLoad
:
self.searchDisplayController.searchResultsDelegate = self;
self.searchDisplayController.delegate = self;
I've even tried:
self.searchDisplayController.searchResultsTableView.delegate = self;
The searchResultsTableView is the only UITableView
in this view controller.
The code you show in your question is didDeselect, not didSelect. So, if that's what you actually have in your code, that's the problem.