Core data one-to-many: how to set relationship for newly added 'many' objects?
Core data one-to-many: how to set relationship for newly added 'many' objects?
- Subject: Core data one-to-many: how to set relationship for newly added 'many' objects?
- From: Arthur C. <email@hidden>
- Date: Wed, 22 Oct 2008 22:55:47 +0200
- Importance: Normal
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. But I'm not allowed to do a fetchRequest from here, right?
What is a clean way to do this? At this moment I have the department pre-fetched somewhere (like in AppDelegate), but that's probably not the right approach.
Thanks for your time,
Arthur C.
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden