NSArray *tempArrays = @[@[@"1.0",@"0.78",@"8.99",@"4.67",@"999"],@[@"2.0",@"0.18",@"3.99",@"4.67",@"1200"]];
NSMutableArray *priceArrays = [NSMutableArray array];
[tempArraysenumerateObjectsUsingBlock:^(NSArray *_Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
[objenumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
[priceArraysaddObject:obj];
}];
}];
CGFloat minValue = [[priceArrays valueForKeyPath:@"@min.floatValue"] floatValue];
CGFloat maxValue = [[priceArrays valueForKeyPath:@"@max.floatValue"] floatValue];
NSLog(@"min---%.2f,max---%.2f",minValue,maxValue);
备注: 从valueForKeyPath可以看出,此处运用了KVC。