If "intValue" is not the key in your dictionary, the key path will not bring much benefit.
If this is the maximum age, you should use @"@max.age" (in the dictionary) to get it. The same applies to any other key in your dictionary.
[myDictionary valueForKeyPath:@"@max.age"];
If numbers is an array of values, you can use @"@max.self" as the key path to get the highest value.
[myArrayOfNumbers valueForKeyPath:@"@max.self"];
David Rönnqvist
source share