I'm messing around with Core Data, and I am sure I am missing something obvious, because I cannot find an example that at all resembles what I am trying to do.
Let's say I'm playing around with a DVD database. I have two entities. A Movie (title, year, rating, and a relationship to Actor) and Actor (name, sex, picture).
Getting all the Movies is easy. It's just:
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Winery"
inManagedObjectContext:self.managedObjectContext];
Getting all the Movies with "Kill" in the title is easy, I just add a NSPredicate:
NSPredicate *predicate = [NSPredicate predicateWithFormat:
@"name LIKE[c] "*\"Kill\"*""];
But Core Data seems to abstract out the id fields for the managed objects... so how to I query against an attribute that is an object (or: query against a relationship)?
In other words, assuming that I already have the Actor object I am concerned with ([Object id 1 - 'Chuck Norris'] for instance), what is the Predicate format for "Give me all movies starring [Object id 1 - 'Chuck Norris']"?