iphone - How to create an NSMutableArray of floating point values -


I'm new to Objective-C and iPhone development, and I try to store floating-point values ​​in an NSMutableArray I am doing this, but when I get an error, the "addObject" incompatible type for logic 1 is "what am I doing wrong? I am trying to create an array of doubles with which i can calculate math .

NSMutableArray only holds the object So that you want to load an array with NSNumber objects. To keep your double, add each nsnm to your array. Probably something like this

  NSMutableArray * array = [[NSMUTABELARROL] INST]; NSNumber * New = [NSNumber Number Explosion: 10.0F]; [Array addObject: num];  

Repeat as necessary.


Comments