max for()

- (void)viewDidLoad {

[superviewDidLoad];

// Do any additional setup after loading the view, typically from a nib.

NSArray*arr =@[@"5",@"8",@"44",@"32",@"1",@"200",@"1111",@"300"];

NSIntegermax =0;

for(inti=0;i<[arrcount];i++) {

if([[arrobjectAtIndex:i]integerValue] > max) {

max = [[arrobjectAtIndex:i]integerValue];

}

}

NSLog(@"max===%ld", max);

}

你可能感兴趣的:(max for())