Basically I got 3 entities in my data model : Brand, Model and Trim.
The keyword IN can be used but you cannot apply ANY at the same time as that does not make sense when you turn it into SQL.
The predicate you are most likely looking for is:
[NSPredicate predicateWithFormat:@"models.trims IN %@", arrayOfTrims];
But that isn't going to work in this case either because you are going across a relationship. So what you need to do is reverse the whole thing:
NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"Model"];
[request setPredicate:[NSPredicate predicateWithFormat:@"trims in %@", arrayOfTrims]];
NSError *error = nil;
NSArray *modelArray = [moc executeFetchRequest:request error:&error];
if (!modelArray) {
NSLog(@"Error: %@\n%@", [error localizedDescription], [error userInfo]);
}
NSArray parentObjectArray = [modelArray valueForKey:@"${PARENT_RELATIONSHIP_NAME}"];
Basically you are fetching the child objects to satisfy your ANY and then using KVC to retrieve the parent objects that you care about.