I have a Core Data model setup like so:
You can traverse relationships in an NSPredicate
. For example, you could write something like
[NSPredicate predicateWithFormat:@"title == %@ AND blockbuster.name LIKE \"Blockbuster C\"", @"Transformers 2"]
Now, if you don't have a property to compare against and you need to check actual objects, then you could use something like
[NSPredicate predicateWithFormat:@"title == %@ AND blockbuster IN %@", @"Transformers 2", setOfBlockbusters]
The full syntax is documented here. But setOfBlockbusters
could be a set, an array, or a dictionary (if it's a dictionary, the values, not the keys, are used).