• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Best practice for Core Data "ordered" NSArray problem?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best practice for Core Data "ordered" NSArray problem?


  • Subject: Re: Best practice for Core Data "ordered" NSArray problem?
  • From: "I. Savant" <email@hidden>
  • Date: Fri, 28 Sep 2007 13:56:51 -0400

> Creating an
> actual array (you now where things are in sequence irrespective of an
> external sorting order) thus means adding an index to the model,
> which makes life difficult for NSArrayController and demands lots of
> custom coding, etc..

  I'm not sure I agree with this assessment. Whether or not you have
an "index" attribute in your model doesn't really make anything more
"difficult" for an NSArrayController than not using Core Data at all.
In either case, you set the sort descriptor and you're done (for
simple retrieval / display).

  The controller layer's job is to apply the logic when drag and drop
reordering occurs, which takes exactly as much work for a Core Data
app as a non-Core Data app with Bindings. There are several very
well-written examples on the web  of how to accomplish this with a
table view. It's a bit obtuse with an outline view and
NSTreeController, granted, but you don't appear to be using either.

  The bottom line is, the clearest route is a "sortOrder" attribute
and some (relatively basic) custom controller code and, speaking from
experience, it works perfectly.

--
I.S.
_______________________________________________

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

References: 
 >Best practice for Core Data "ordered" NSArray problem? (From: Frank Reiff <email@hidden>)

  • Prev by Date: Re: fast blitting with Quartz
  • Next by Date: Re: fast blitting with Quartz
  • Previous by thread: Re: Best practice for Core Data "ordered" NSArray problem?
  • Next by thread: Re: Best practice for Core Data "ordered" NSArray problem?
  • Index(es):
    • Date
    • Thread