I'm trying to sort through an array of objects to find the highest number. I'm fairly new with objective C (and C in general), so I am not sure why this isn't working, although my gut says its probably due to the NSNumber declaration. The max variable is always returned as random value from the array. Any ideas?
NSNumber * max = 0;
for (int i=0; i<mutableChartData.count; i++) {
if ([mutableChartData objectAtIndex:i] > max) {
max =[mutableChartData objectAtIndex:i];
}
}