I have a UISearchBar with some odd behaviour (iOS 7). These are the steps I take:
1) I do a search and select a result from the table.
2) I clear the search text with this code (either line)
-(void) tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[[[self searchDisplayController] searchBar] setText:nil];
[[[self searchDisplayController] searchBar] setText:@""];
//other stuff
}
3) I do a second search. But no results are shown unless I first hit the "clear button" inside the search field. After hitting the "x", the behaviour returns to normal.
How are you supposed to clear the search string after the user selects one of the search results?