The searchResultsTableView
of my UISearchDisplayController
is always hidden (hidden=YES
) in searchDisplayControllerDidBeginSearch:
. Setting the property manually does not help unfortunately.
Here is my code:
self.searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
self.searchController = [[UISearchDisplayController alloc] initWithSearchBar:self.searchBar contentsController:self];
self.searchController.delegate = self;
self.searchController.searchResultsDataSource = self;
self.searchController.searchResultsDelegate = self;
self.searchController.searchResultsTableView.clipsToBounds = NO;
self.menuList.tableHeaderView = self.searchBar;
The search bar is correctly shown, but when I start searching and click into the search bar the whole table view is gone.
- (void)searchDisplayControllerDidBeginSearch:(UISearchDisplayController *)controller
{
// po self.searchController.searchResultsTableView
// <UISearchResultsTableView: 0xc8ff600; frame = (0 0; 320 284); hidden = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0xc08f370>; layer = <CALayer: 0xc08f0b0>; contentOffset: {0, 0}>
}