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
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
|