I have an NSArray filled with custom objects. Each object has several variables: pk, amount, date etc..
I want to fetch the object that has the highest number in the pk variable. 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 that object. I have seen indexOfObject used when the array has just 1 variable of data, but how do I use it in this instance?
Thanks