views:

38

answers:

1

I have an NSManagedObject who has a one to many relationship with the parent Object. How can I get the parent object using the child object?

A: 

You can set up a @property to access it and then call the @property

id parent = [myChild parent];

Or you can access it via KVC

id parent = [myChild valueForKey:@"parent"];
Marcus S. Zarra
Let me clarify my question, What I want is for instance I have a parent object (Dealers) and a dealer has many (cars), now in a tableview I'm showing all the cars there are, but as I show each car in the tableview I want to display the Dealers Name...So would that work?
Jimmy
Thankss it works great!
Jimmy