0

I find that the only way to build a UISearchDisplayController is to also build a UISearchBar onto my UITableViewController.

However, I don't want a UISearchBar to show up, and would like to initiate the search via a button press instead.

Is this possible?

I tried activating the UISearchDisplayController on button press:

- (void)searchButtonPressed:(id)sender{
  [self.searchDisplayController setActive:YES animated:YES];
}

This "works", but the searchDisplayController that shows up has no UISearchBar. (Obviously).

Razor Storm
  • 12,167
  • 20
  • 88
  • 148
  • A `UISearchDisplayController` is specifically written to use a `UISearchBar`. If you don't have a search bar don't use a `UISearchDisplayController`. What kind of UI do you have that allows for a search without the user entering any search criteria? – rmaddy Apr 25 '14 at 20:50
  • Well when the UISearchDisplayController shows up, I _do_ want to show a searchBar (which is the problem I am having right now). I just don't want the search bar to be present if the UISearchDisplayController isn't showing up. – Razor Storm Apr 25 '14 at 20:55

1 Answers1

0

I ended up just setting the hidden field to NO and YES when the search display controller is shown and dismissed.

Razor Storm
  • 12,167
  • 20
  • 88
  • 148