I'm using UISearchBar in my app.
- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope
{
[self.filtered removeAllObjects];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF.companyName contains[cd] %@",searchText];
NSArray *tempArray = [ee filteredArrayUsingPredicate:predicate];
filtered = [NSMutableArray arrayWithArray:tempArray];
}
I did NSLog
on above "filtered" array, it's getting proper search results.
I don't see the filtered values in the tableview. I see "No results" if I type wrong search text. But for the correct search text, the table view is plain empty.
Can anyone help me what needs to be done?
Thanks in advance!!