So I\'m trying to fetch objects from core data. I have list of say 80 objects, and I want to be able to search through them using a UISearchBar. They are displayed in a tab
In typical Core Data application one should delete NSF fetchedResultsController:
[NSFetchedResultsController deleteCacheWithName: [self.fetchedResultsController cacheName]];
Or else you'll get an exception (ideally) or you'll have strange behavior.
use contains[cd] instead of like, and change:
NSPredicate *predicate =[NSPredicate predicateWithFormat:@"All"];
to:
NSPredicate *predicate =[NSPredicate predicateWithFormat:@"1=1"];
Did you try it using MATCH and regular expressions? Just curious to see if LIKE is something that should be avoided on the iPhone or not...
It seems as though iPhone doesn't like the LIKE operator. I replaced it with 'contains[cd]' and it works the way I want it to.