• 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: A custom way to sort EOs by key ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A custom way to sort EOs by key ?


  • Subject: Re: A custom way to sort EOs by key ?
  • From: Fabrice Pipart <email@hidden>
  • Date: Fri, 11 May 2007 09:55:27 +0200

On May 10, 2007, at 11:19 PM, Matthew W. Taylor wrote:
It sounds like what you want to do is perform "Natural" sort ordering to the results.  
sortedArray = unsortedArray.sortedArrayUsingComparator(new EOCustomObjectNaturalOrderComparator("nameOfKeyToSortBy"));

//  EOCustomObjectNaturalOrderComparator.java

That's absolutely what I was looking for :-)
I had just missed the NSArray.sortedArrayUsingComparator method :(
And it's far more obvious how to subclass a NSComparator than a NSSelector ;-)

The only drawback compared to EOSortOrdering.sortedArrayUsingKeyOrderArray is that I cannot do ordering  for several keys : ORDER BY name, otherKey ...

Ken : I wanted to do the ordering in memory and since the name is user input, it would not be very easy to separate the number in a different column

David : the ordering column would have been a great idea (I keep it in mind for later use) if I had a user-given order ie List as Robert said. I would still be curious to know if a list mechanism is implemented in ProjectWonder.


Thanks to all of you who answered me :-)
You don't imagine how valuable the list's help is to me.


I hope to meet some of you at WWDC

Regards

Fabrice




www.easyshadow.com

International Corporate Consulting
Palais de la Scala
1 avenue Henri Dunant
Suite 1155
MC - 98000 Monaco

Skype: fabrice.pipart
Tel.  +377 97 98 21 04 (direct)
Fax. +377 97 70 88 07


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

 _______________________________________________
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

  • Follow-Ups:
    • Re: A custom way to sort EOs by key ?
      • From: Lachlan Deck <email@hidden>
    • Re: A custom way to sort EOs by key ?
      • From: Chuck Hill <email@hidden>
References: 
 >Re: A custom way to sort EOs by key ? (From: Robert Walker <email@hidden>)
 >Re: A custom way to sort EOs by key ? (From: "Matthew W. Taylor" <email@hidden>)

  • Prev by Date: Re: MSIE is not the postman
  • Next by Date: Re: action not being called inside conditional/repetition
  • Previous by thread: Re: A custom way to sort EOs by key ?
  • Next by thread: Re: A custom way to sort EOs by key ?
  • Index(es):
    • Date
    • Thread