Re: CoreData, OutlineView, and NSTreeController
Re: CoreData, OutlineView, and NSTreeController
- Subject: Re: CoreData, OutlineView, and NSTreeController
- From: Scott Stevenson <email@hidden>
- Date: Fri, 20 May 2005 08:18:42 -0700
On May 19, 2005, at 9:22 PM, Lee Morgan wrote: This is similar to a problem, expect mine is CoreData entities being ordered incorrectly in menus. I'm having to "correct" this over and over again in my app. Unlike an array where items are ordered by the order that you add them to the array in, the NSSet that CoreData uses isn't - best guess is NSSet has some performance gain over NSArray? In turn I've been having to implement Sort Descriptors (NSSortDescriptor) all over the place. This is quite annoying, but I haven't found a better way.
I thought it was strange at first too, but I now actually think it makes sense. If you think about it, managed objects have no inherent order in a context. In that sort of model, NSSet makes more sense as the "native" collection class, particularly for things like search fields.
I'm not sure this is the only reason NSSet was used, though. At last year's WWDC, one of the Core Data team members mentioned that one challenge with supporting NSArray is that it can contain more than one instance of the same object.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden