I've never seen it documented though perceived performance would indicate this is indeed the case. I've rarely come across a case where sort descriptors weren't "fast enough" (indeed, given how well they work with bindings it is somewhat essential). In general, if this route is too slow then you probably should consider what your storage is like - for instance, pre-calculating some value and caching in a way that is simple to compare, etc. The original poster in this thread mentioned the requirement of using external data sources for the sorting and while I understand that it sometimes is a necessity, I'd strongly avoid doing something like executing a query against a remote db for each item in a table view for reversing the order (I imagine it's not that horrid an example but you get my point). A better design would be for the external data to alert the object to be sorted that it's changed so that it could re-calculate and cache. Your UI should be responsive as possible. At a certain point, even the fastest sorting techniques will become slow due to the size of data and the ancillary tasks involved.

-rob.

On Dec 21, 2008, at 11:04 PM, Scott Ribe wrote:

Have you tried using NSSortDescriptor for sorting?  It caches the
result of valueForKeyPath: internally, and is quite fast (as long as
you don't subclass it).

No. The documentation doesn't mention caching of values, and I had no idea
it would do that.

--
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/rob%40pinchmedia.com

This email sent to r...@pinchmedia.com

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to