ios - How to find sum of all objects for some key in array of dictionaries? -
this question has answer here:
i have array of dictionaries.
nsarray* mydicionariesarrey = ( object 1: { keytoculc: 30 } , object 2: { keytoculc: 40 } )
how find sum of objects keytoculc key in array, simple command? (30+40=70)
int sum = [mydicionariesarrey valueforkeypath:@"@sum.keytoculc"];
nb: untested, written memory.
Comments
Post a Comment