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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill% 40global-village.net

This email sent to [EMAIL PROTECTED]

--
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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to