// 快速求和、平均值、最大值、最小值NSArray *array = @[@1,@2,@3,@4,@5.3];NSNumber *sum = [array valueForKeyPath:@"@sum.intValue"];float avg = [[array valueForKeyPath:@"@avg.floatValue"] floatValue];int max = [[array valueForKeyPath:@"@max.intValue"] intValue];int min = [[array valueForKeyPath:@"@min.intValue"] intValue];NSLog(@"%@ %f %d %d ",sum,avg,max,min);复制代码