• 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: Sort in memory over multiple fields
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Sort in memory over multiple fields (From: "John Huss" <email@hidden>)

  • Prev by Date: Re: NSFormatter usage
  • Next by Date: Re: Unable to update or make changes in the table
  • Previous by thread: Sort in memory over multiple fields
  • Next by thread: Re: Sort in memory over multiple fields
  • Index(es):
    • Date
    • Thread