I have an NSArray populated with custom objects. Each object has several variables: pk, quantity, date, etc.
I want to get the object that has the largest number in the variable pk. I can do this using:
NSUInteger maximumpk = [[bets valueForKeyPath:@"@max.pk"] intValue];
This gives me the actual value from the highest pk. Now I need to get the index for this object. I saw indexOfObject when an array has only 1 data variable, but how can I use it in this instance?
thanks
source share