Re: When NSArray is not an Array
Re: When NSArray is not an Array
- Subject: Re: When NSArray is not an Array
- From: Mark Onyschuk <email@hidden>
- Date: Sun, 14 Jan 2007 21:28:47 -0500
Really this is something that I hope the CoreData team eventually
addresses - transparent support for ordered collections in the model
layer, rather than something up in controller.
For an example of a nicely executed implementation of similar, check
out Ruby/Rails' ActiveRecord support for ordering - acts_as_list -
where the model layer transparently supports an order attribute on
collections. There's a lot of other capabilities in ActiveRecord that
CoreData would benefit from having as well - acts_as_nested_set for
example (assuming that we're backing data off on a relational db).
Exclusive support for unordered collections in the framework just
smells of "implementation detail" bubbling up from CoreData's
underlying support for relational databases as a potential backing
store.
Anyhow, it seems to me that there's likely a way of implementing
generic support for ordered collections in a subclass of
NSManagedObject with a little extra information added to an
xcdatamodel. If anyone would like to have such a thing, perhaps drop
me an email and if there's sufficient interest, I'll see if I can
code up something for general consumption. I'm likely going to do
this for myself in any case as I've run up against the lack of
support often, and an NSController-based solution strikes me as just
the wrong place for this logic.
-Mark
On 11-Jan-07, at 5:25 PM, David Catmull wrote:
On Jan 11, 2007, at 2:09 PM, "I. Savant"
<email@hidden> wrote:
That said, it really isn't *that* complicated to create a generic,
reusable NSArrayController subclass that updates the sortOrder key
Has anyone written one that could be made available as public
domain or open source? This ordering issue was my main reason for
not using CoreData.
--
David Catmull
email@hidden
http://www.uncommonplace.com/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
40rogers.com
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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