• 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
NSComparator not adequate?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: NSComparator not adequate?
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: WOLongResponsePage -- An Alternative
  • Next by Date: Re: NSComparator not adequate?
  • Previous by thread: batch fetching faults
  • Next by thread: Re: NSComparator not adequate?
  • Index(es):
    • Date
    • Thread