Miguel,

What type of criteria are you trying to sort by?

Here's a code snippet if you wanted to sort a relationship.
In this example there's a relationship between Cafe <--->> Menu

public NSArray orderedMenus() {
EOSortOrdering sortOrdering =
new EOSortOrdering("ordering", EOSortOrdering.CompareCaseInsensitiveAscending);
NSMutableArray sortOrderings = new NSMutableArray(sortOrdering);
NSArray orderedMenus =
EOSortOrdering.sortedArrayUsingKeyOrderArray(this.menus(), sortOrderings);
return orderedMenus;
}

But, since you're saying that alphabetic sorting isn't enough, then you might have to do what was done in the above example, which is add a field to your EO that is used specifically for sorting.

If you're trying to sort numerically, then you'll want to make sure that the database field is a number and not a string.

- Joe



On Feb 17, 2006, at 11:08:29, Miguel Arroz wrote:

Hi!

  This is probably a simple question, but I'm not finding an answer... how can I sort objects in memory using my own criteria? The alphabetic ordering is not enough... :)

  Yours

Miguel Arroz

      "GUERRA E' PAZ
       LIBERDADE E' ESCRAVIDAO
       IGNORANCIA E' FORCA"       -- 1984

Miguel Arroz



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:

This email sent to [EMAIL PROTECTED]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Reply via email to