I have a NSArray and want to know the maximum and min integers.
I currently use:
int max = [[array valueForKeyPath:@"@max.intValue"] intValue];
int min = [[array valueForKeyPath:@"@min.intValue"] intValue];
but now I want to know the minimum and maximum without the zeros entering (arrays only have positive values)
ex:
array=[3, 6 ,7 , 13, 86, 45, 0]
min=3
max=86
Is there any method to achieve this?