• 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: Finder-style sorting and the SQL Core Data store, best practice?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finder-style sorting and the SQL Core Data store, best practice?


  • Subject: Re: Finder-style sorting and the SQL Core Data store, best practice?
  • From: "Melissa J. Turner" <email@hidden>
  • Date: Tue, 1 Sep 2009 14:43:00 -0700

As of SnowLeopard, Core Data supports the following selectors for sorting in the SQLite store:

compare: (since Tiger(I think))
caseInsensitiveCompare: (since Leopard)
localizedCompare: (new in SL)
localizedCaseInsensitiveCompare: (new in SL)
localizedStandardCompare: (new in SL)

The last comparison type is new to the OS in SL, and will get you the system standard sort as done by Finder.

As to subclassing NSArrayController, I'll leave that to people with more UI-fu.

+Melissa


On Sep 1, 2009, at 13:10, Sean McBride wrote:

Hi all,

The "Troubleshooting Core Data" document discusses the FAQ "SQLite store
does not work with sorting". It suggests: "you may need to subclass
NSArrayController so you can have it not pass the sort descriptors to
the database and instead do the sorting after your data has been fetched". [1]


I imagine this must have been done many times over by many people. Try
as I may, I cannot find any example code, or even a more detailed
discussion of what to override. I fear there may be edge cases
overriding such an important class, so want to be careful.


My ultimate goal is for all table and outline views in my app to sort
"correctly" (ie like the Finder[2]).

What is the correct way to achieve this?

[1] <http://developer.apple.com/mac/library/documentation/Cocoa/
Conceptual/CoreData/Articles/cdTroubleshooting.html>
[2] <http://developer.apple.com/mac/library/documentation/Cocoa/
Conceptual/Strings/Articles/SearchingStrings.html>

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


  • Follow-Ups:
    • Re: Finder-style sorting and the SQL Core Data store, best practice?
      • From: "Sean McBride" <email@hidden>
References: 
 >Finder-style sorting and the SQL Core Data store, best practice? (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: SCNetworkReachability and impact of Snow Leopard
  • Next by Date: Re: Scripting Bridge and multiple attachments
  • Previous by thread: Finder-style sorting and the SQL Core Data store, best practice?
  • Next by thread: Re: Finder-style sorting and the SQL Core Data store, best practice?
  • Index(es):
    • Date
    • Thread