Re: Sort in memory over multiple fields
Re: Sort in memory over multiple fields
- Subject: Re: Sort in memory over multiple fields
- From: Chuck Hill <email@hidden>
- Date: Thu, 9 Feb 2006 10:25:39 -0800
Hi John,
You have two choices:
1. Create an NSArray of EOSortOrdering and then use the static
EOSortOrdering met hods sortArrayUsingKeyOrderArray or
sortedArrayUsingKeyOrderArray
2. Create an NSComparator and use the NSArray method
sortedArrayUsingComparator or the NSMutableArray method
sortUsingComparator
Either works, the NSComparator is perhaps a tad faster as it can
avoid some KVC but I would not let that sway my decision. I prefer
NSCompartor in most cases as I can make the NSComparator subclass an
inner class of my EO and thus keep the ordering logic there. I also
find it makes it easier to write and understand more complex orderings.
Chuck
On Feb 9, 2006, at 10:09 AM, John Huss wrote:
What's the best way to sort a dataset in memory using multiple fields?
I have access to Project Wonder to do it.
Thanks,
John
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Coming in 2006 - an introduction to web applications using WebObjects
and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden