floats in NSArray

Posted by JordanC on Stack Overflow See other posts from Stack Overflow or by JordanC
Published on 2012-10-08T15:29:40Z Indexed on 2012/10/08 15:37 UTC
Read the original article Hit count: 183

Filed under:
|
|
|

I have an NSArray of floats which I did by encapsulating the floats using

    [NSNumber numberWithFloat:myFloat] ;

Then I passed that array somewhere else and I need to pull those floats out of the array and perform basic arithmatic. When I try

    [myArray objectAtIndex:i] ;

The compiler complains that I'm trying to perform arithmatic on a type id. It also won't let me cast to float or double.

Any ideas? This seems like it should be an easy problem. Maybe it will come to me after another cup of coffee, but some help would be appreciated. Thanks.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about xcode