Skip navigation.
 
mlCore Data help needed (relationship programmatically)
FROM : Ralph Manns
DATE : Tue Feb 19 23:45:47 2008

Core Data newbie question:

I have one entity "Category" with a property "categoryName" , a one-to-
many relationship "children" and an inverse  one-to-one relationship 
"parent".
My question: how do I add an object and set the relationship. In 
Apple's department-employee example is this done with:

NSMutableSet *employees;
employees = [department mutableSetValueForKey: @"employees"];
[employees addObject: newEmployee];

But there are two entities. How do I add a new employee and set the 
manager or directReports relationship in Apple's example?

Can someone give me a hint. Thanks.

Ralph.

Related mailsAuthorDate
mlCore Data help needed (relationship programmatically) Ralph Manns Feb 19, 23:45
mlRe: Core Data help needed (relationship programmatically) I. Savant Feb 19, 23:52
mlRe: Core Data help needed (relationship programmatically) Ralph Manns Feb 20, 00:58
mlRe: Core Data help needed (relationship programmatically) I. Savant Feb 20, 01:03