I have an Artist object with a .localConcerts
fetched property (basically a subset of the full .concerts
set), can I use that property inside my NSFetchedResultsController predicate?
Here's what I'm trying:
NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Artist" inManagedObjectContext:context];
[request setEntity:entity];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"localConcerts.@count > 0"];
[request setPredicate:predicate];
fetchedResultsController = [[NSFetchedResultsController alloc]
initWithFetchRequest:request
managedObjectContext:context
sectionNameKeyPath:nil
cacheName:nil];
But I'm getting:
'keypath localConcerts not found in entity <NSSQLEntity Artist id=1>'
Am I missing anything or is it just not possible to use fetched properties inside predicates?