I am trying to find out maximum value from an array using @"@max.self" but it is returning nil when I try to run it on iOS 9.3.5 device, for the Higher version it works properly and returns the proper value.
NSNumber *maxOfBarGraphValues = [arrayOfBarGraphValues valueForKeyPath:@"@max.self"];
NSLog(@"%@",[[arrayOfBarGraphValues valueForKeyPath: @"@max.self"]floatValue] );
Below I am attaching output for the NSLog statement and value of arrayOfBarGraphValues from the console.
Printing description of self->arrayOfBarGraphValues: <__NSArrayM 0x16e1ffc0>
(
5,
4,
7,
7,
6,
6,
7,
7,
7,
7,
7,
7,
7
)
(lldb) po maxOfBarGraphValues
nil
Follow this code hope will helpful to you.