What I’m looking for is a succinct way to fetch a core-data object that is identified uniquely by its relationships. e.g., given the data model:

… and given a set of NSManagedObject nodes, I’d like to fetch a triangle, or at least know if a TriangleEntity exists like so:
NSSet *nodeSet = // a set of 3 NSManagedObject*s
NSFetchRequest *request = [[NSFetchRequest alloc] initWithEntityName:@"TriangleEntity"];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"corners CONTAINS ALL %@", nodeSet];
I don’t think that CONTAINS ALL is proper syntax — And I know that I could just unpack the NSSet and fetch
@"corners CONTAINS %@ AND corners CONTAINS %@ AND corners CONTAINS %@", setObj1, setObj2, setObj3
… but that seems silly. Is there a more elegant solution?
The following predicate finds triangles where all corners are in the given set:
nodeSetcan be anNSSetor anNSArray.