Given the following Core Data Model:
-> : to-one releationship
->>: to-many relationship
Entity A ->> Entity B
Entity B -> A // each B belo
Does
[NSPredicate predicateWithFormat:@"A==%@ AND (ALL %@ IN Bs)", Ax, myArray];
do what you expect? I am not sure (and away from my OS X box) whether this predicate is translatable to SQL for the Core Data SQLite engine. You may need a SUBQUERY expression:
[NSPredicate preidcateWithFormat:@"A==%@ and SUBQUERY(Bs, $x, $x IN %@).@count == %d", Ax, myArray, myArray.count];
This assumes that the items in myArray
are unique.