On 2008 Oct, 22, at 13:55, Arthur C. wrote:

A basic question:
I have a Core Data model which has a one-to-many relationship, say one Department and several Employees.

When an Employee is added using the 'add' button of the standard interface, how can I set the relationship to the (one) instance of Department? It means you need access to theDepartment from Employee - awakeFromInsert.


I don't think so. Getting a reference to one of your objects should be trivial. Note that -[NSManagedObject insertNewObjectForEntityForName:inManagedObjectContext] returns the newly-inserted object.

If you need to post a follow-up, please clarify: Are you working with Apple's DepartmentsAndEmployees Sample Code project?

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to