this doesn't directly address my concern.. but it limits the damage somewhat. I created a local variable that stores if the search is active:
- (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller {
isSearchViewDisplayed = YES;
}
- (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller {
isSearchViewDisplayed = NO;
}
I noticed upon further inspection that the first thing the tableview asks its UITableViewDataSource
is the number of sections.. everything (ie number of rows per section, and rendering of cells) happens after that.. so I simply returned 0 at the section checking part:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
if (tableView == self.searchDisplayController.searchResultsTableView
|| !isSearchViewDisplayed) {
return 1;
} else {
return 0;
}
}
I won't mark this as correct.. just waiting to see if there is a better answer out there.