Yes, as already suggested by Preston, key path operators are very expressive.
Thanks for the suggestions.
Jean

On Mon, Jul 12, 2010 at 4:31 PM, Keith Duncan <ke...@33software.com> wrote:
>> overkill. You can get less, faster code by using a for/in loop:
>>
>> float minValue = INFINITY;
>> for(id obj in someTrips)
>>    minValue = MIN(minValue, [[obj adultFinalPrice] floatValue]);
>
> You could get even less, more expressive code, using key path operators:
>
> NSNumber *minValue = [someTrips valueForKeyPath:@"@min.adultFinalPrice"];
> NSNumber *maxValue = [someTrips valueForKeyPath:@"@max.adultFinalPrice"];
>
> Keith
>
> _______________________________________________
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/g.castaldi%40gmail.com
>
> This email sent to g.casta...@gmail.com
>



-- 
“We are what we repeatedly do. Excellence then, is not an act, but a habit.”
Aristotle
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to