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:
- Why won't my UISearchDisplayController fire the didSelectRowAtIndexPath method?
- didSelectRowAtIndexPath does not work when uitableview datasource is filtered
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.