Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Core Data and ordered relationships
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data and ordered relationships



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



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.