标签: objective-c arrays
我想要一个像这样的浮点数数组: {0.25,0.50,0.75,1.0,1.25,1.50,1.75,2.0,2.25,.. 100}
如何生成它,直到100代码?
答案 0 :(得分:0)
在Objective-C(iOS)中:
NSMutableArray *array = [NSMutableArray array]; for (float i = 0.25; i <= 100; i = i + 0.25) [array addObject:@(i)];