Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleParser



That does, would help it was native but what you going to do =)

Thanks

hey... got an easy way to sortOn multiple keys? =)

Well, the easy way is to just call sortOn multiple times, in reverse order of precedence for the search. This will leave you with an array sorted by year, with the items that all have the same year sorted by title:


items.sortOn('title');
items.sortOn('year');

I'm 99% certain that Array.sort maintains pre-sort order for equal items, which is why this works. If you want it to be more efficient, you could modify that sortOn function to take key1 and key2, or to take a variable number of keys.

-Nate
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: AppleParser (From: "Nate Heagy" <email@hidden>)
 >Re: AppleParser (From: John Louch <email@hidden>)
 >Re: Re: AppleParser (From: "Johnny Storm" <email@hidden>)
 >Re: AppleParser (From: Nate Cook <email@hidden>)
 >Re: Re: AppleParser (From: "Johnny Storm" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.