0

I want to show the searchResultsTableView when my searchBar is selected. I have tried this:

- (void) searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller {
    [self.searchDisplayController.searchResultsTableView reloadData];
    [self.searchDisplayController setActive:YES animated:YES];
}

and this:

- (void) searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller {
    [self.searchDisplayController setActive:YES animated:YES];
}

Neither works. In my numberOfRowsInSection method, I do have rows in the array, but the searchResultsTableView does not show until I start typing. Any thoughts? Thanks!

Crystal
  • 28,460
  • 62
  • 219
  • 393

1 Answers1

0

Try to set your searchdisplaycontroller to active in the following UISearchBarDelegate method

- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar;                     
Ilker Baltaci
  • 11,644
  • 6
  • 63
  • 79