Hi All,
I have an iPhone app that has a table with search functionality. I have a weird bug, where if I come from one tab into this table (doesn't happen if I go directly into the tab with the table) and choose to search, it crashes with the error code that I set as the title: Can't use in/contains operator with collection 1423 (not a collection) where 1423 changes between runs. I have a core data entity which has a NSNumber attribute which I'm trying to search.
What I do is this:
From doing a Google search, I found this: http://stackoverflow.com/questions/...e-sometimes-throws-nsinvalidargumentexception
But can't find anything in there that helps me solve my problem. Any ideas what could be going on?
I have an iPhone app that has a table with search functionality. I have a weird bug, where if I come from one tab into this table (doesn't happen if I go directly into the tab with the table) and choose to search, it crashes with the error code that I set as the title: Can't use in/contains operator with collection 1423 (not a collection) where 1423 changes between runs. I have a core data entity which has a NSNumber attribute which I'm trying to search.
What I do is this:
Code:
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
{
NSPredicate *searchPredicate = nil;
if (searchString.length > 0) {
// set the predicate
searchPredicate = [NSPredicate predicateWithFormat:@"number contains %@", [NSNumber numberWithInteger:searchString.integerValue]];
// searchPredicate = [NSPredicate predicateWithFormat:@"number contains %@", searchString];
// the above line doesn't work either
}
[self setupFetchedResultsControllerForPredicate:searchPredicate];
return YES;
}
From doing a Google search, I found this: http://stackoverflow.com/questions/...e-sometimes-throws-nsinvalidargumentexception
But can't find anything in there that helps me solve my problem. Any ideas what could be going on?