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
2010-04-04 00:13:24
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
2010-04-04 00:19:47
Thankss it works great!
Jimmy
2010-04-04 00:22:36