【发布时间】:2011-03-20 13:21:28
【问题描述】:
NSArray chemConstantArray = [[NSArray alloc] initWithObjects:0.0021400, 0.0012840, 0.0010700, nil];
给我四个错误:
Incompatible type for argument 1 of 'initWithObjects:'
Invalid initializer
Statically allocated instance of Objective-C class 'NSArray' x 2
这是有道理的,因为浮点数不是对象,但我怎样才能制作一组浮点数。我也需要一个用于 BOOL 的。
【问题讨论】:
标签: iphone objective-c arrays floating-point boolean