Core Data and ordered relationships
Core Data and ordered relationships
- Subject: Core Data and ordered relationships
- From: "Sean McBride" <email@hidden>
- Date: Mon, 15 Sep 2008 17:55:40 -0400
- Organization: Rogue Research
Hi all,
There have been discussions in the past about the fact that
relationships in Core Data are unordered (sets) instead of ordered
(arrays). I have a vague question about this...
In my model: entity 'Department' has a to-many relationship to entity
'Employee' named 'employees'. There are a maximum of 6 employees and
their order is important. How to take that into account? Should I:
a) add relationships named employee1, ..., employee6, in the xcdatamodel?
b) add an attribute named 'index' (value 1 to 6) and code methods named
employee1, etc. in my NSManagedObject subclass?
I want to be able to bind NSViews using 'employeeX' in the keypath. For
example, I'd like to bind an NSTextfield's value to
departmentController.employee3.fullName.
Thanks,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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