I have a UISearchBar. When the user touches the UISearchBar, a UIPopoverController is shown that contains a UITableView of results. As the user types, the results appear.
I want the user to be able to touch the grey x button in the UISearchBar to clear the search results and clear the UISearchBar's text field. However, the first touch simply dismisses the UIPopoverController, prompting the user to touch the button a second time to clear out the text field.
Is there a way to allow touch interaction with other object while a UIPopoverController is showing?
Try setting the
passthroughViews property of the UIPopoverController to the UISearchBar.
In fact, the Apple sample app ToolbarSearch does exactly this:
// Ensure the popover is not dismissed if the user taps in the search bar. popover.passthroughViews = [NSArray arrayWithObject:searchBar];