NSPredicate 'The left side for an ALL or ANY statement must be either an NSArray or an NSSet'

Not quite sure why this is not working right now, I thought it worked previously. Does anyone see a problem with this FetchRequest construct?

- (NSArray *)entriesForDate:(NSDate *)date { NSFetchRequest *request = [[NSFetchRequest alloc]initWithEntityName:@"Entry"]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ANY addedOn.unique like %@", [T3Utility identifierForDate:date]]; request.predicate = predicate; NSError *error = nil; NSArray *matches = [self.database.managedObjectContext executeFetchRequest:request error:&error]; return matches; } 

Again, I'm 99% sure that this code has been working until recently, so I think maybe something else happens in my code there.,. but when I run it through the debugger, it freezes somewhere. Here is my mistake:

The left side for an ALL or ANY statement must be either an NSArray or an NSSet

Any ideas?

thank!

+5
ios xcode core-data nsfetchrequest nspredicate
Aug 26 2018-12-12T00:
source share
1 answer

addedOn doesn't addedOn be a to-many relation. Make sure you use the correct names for your attributes / relationships in the predicate. Also note that you cannot use the one-to-one relationship in the ANY predicate.

+8
Aug 26 '12 at 7:29
source share
— -



All Articles