• 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: Selecting max in NSArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Selecting max in NSArray


  • Subject: Re: Selecting max in NSArray
  • From: Art Isbell <email@hidden>
  • Date: Thu, 10 Feb 2005 18:17:32 -1000

On Feb 10, 2005, at 5:58 PM, Drew Thoeni wrote:

I have an NSArray with several objects in it. I want to select the object that has the maximum price. However, using valueForKey("@max.item.price") returns, of course, the price for the item instead of the item. Is there a way to do this without having to refetch?

Certainly. You could descend-sort the array on item.price. The 0th element of the sorted array would be the item with the maximum price.


Aloha,
Art

_______________________________________________
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: Selecting max in NSArray
      • From: Anjo Krank <email@hidden>
References: 
 >Selecting max in NSArray (From: Drew Thoeni <email@hidden>)

  • Prev by Date: Selecting max in NSArray
  • Next by Date: Re: Selecting max in NSArray
  • Previous by thread: Selecting max in NSArray
  • Next by thread: Re: Selecting max in NSArray
  • Index(es):
    • Date
    • Thread