Key-Value collection operators
The key-value collection operators are a really useful way to perform operations on collections of data.
NSNumber *amountSum = [transactions valueForKeyPath:@"@sum.amount"];
IMHO it beats iterating over a for-loop and maintaining the sum.
Written by Scott
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ios
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#