NSArray chemConstantArray = [[NSArray alloc] initWithObjects:0.0021400, 0.0012840, 0.0010700, nil];
Gives me four errors:
Incompatible type for argument 1 of 'initWithObjects:'
Invalid initializer
Statically allocated instance of Objective-C class 'NSArray' x 2
Which makes sense, as floats are not objects, but how can I make an array of floats. I need one for BOOLs too.
If you need an array purely within your own code, you can use a regular C array:
If you need an
NSArray*for something, you need to wrap each value into anNSNumber.You can use
numberWithBoolsimilarly for BOOLs.