• 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: Use of blocks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use of blocks


  • Subject: Re: Use of blocks
  • From: Marcelo Alves <email@hidden>
  • Date: Mon, 12 Jul 2010 08:58:32 -0300

On 12/07/2010, at 04:34, Giannandrea Castaldi wrote:

> I've also looked for a solution with NSExpression and NSPredicate with
> the function min/max but if I've correctly understood the use of
> NSExpression and NSPredicate with such functions is only for CoreData.
> Thanks.


See the "Set and Array Operators" inside the "Key-Value Coding Programming Guide". Example :

@max

The @max operator compares the objects returned by sending valueForKeyPath: to each item in the receiver array passing the key path to the right of the array operator as the parameter, returning the maximum value found. The maximum value is determined using the compare: method of the objects at the specified key path. The compared property objects must support comparison with each other.

The following example returns the date of the latest transaction in the savings account:

[savingsAccount valueForKeyPath:@"email@hidden"]


:: marcelo.alves
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Use of blocks (From: Giannandrea Castaldi <email@hidden>)

  • Prev by Date: Re: Use of blocks
  • Next by Date: Re: Use of blocks
  • Previous by thread: Re: Use of blocks
  • Next by thread: NSCollectionView and selecting range
  • Index(es):
    • Date
    • Thread