NSComparator not adequate?
NSComparator not adequate?
- Subject: NSComparator not adequate?
- From: "Robert A. Decker" <email@hidden>
- Date: Mon, 29 Sep 2003 22:28:41 -0700 (PDT)
I'm converting an app from 4.5.1 to 5.2.1. I used NSSelector to sort
arrays on a number of variables. I can't quite figure out how to do this
with the new NSComparator system.
For example, if I have a class WayPoint that describes a geographic
location at a specific instance in time, I may want to sort a group of
waypoints based on time, or I may want to sort a group of WayPoints based
on their coordinates.
With NSSelector I'd write two methods (compareUsingTime and
compareUsingCoordinates) and sort arrays using an NSSelector (NSSelector
sel = new NSSelector("compareUsingTime");).
However, with this NSComparator system I can only use one method -
compare. Also, I don't think EOSortOrdering will work for me because these
objects (WayPoint) aren't actually enterprise objects.
Any suggestions?
thanks,
Robert A. Decker
http://www.robdecker.com/
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.