I have a UISearchBar for a UITableView and my implementation is as follows:
-(void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
{
[self.searchBar becomeFirstResponder];
if(searchText.length == 0)
{
self.isFiltered = NO;
}
else
{
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF.writer1 contains[c] %@", searchText];
self.isFiltered = YES;
[[RTRepairOrderStore sharedStore] filterROArray:predicate];
}
[self.tableView reloadData];
}
The issue is that after I type one letter into the search bar, the search works but the keyboard is immediately dismissed. How can I prevent this?