Why can't I store a float value - it's always zero!

Posted by just_another_coder on Stack Overflow See other posts from Stack Overflow or by just_another_coder
Published on 2010-04-05T05:32:36Z Indexed on 2010/04/05 5:33 UTC
Read the original article Hit count: 257

Filed under:
|

I have a view controller that is created by the app delegate - it's the first one shown in the app.

In its interface I declare

float lengthOfTime;

I also set it as a property:

@property (nonatomic) float lengthOfTime;

And in it's implemetation:

@synthesize lengthOfTime;

In the class viewDidLoad method, I set the value:

self.lengthOfTime = 3.0f;

However, after this, the value is always zero.

No errors, no compile warnings, nothing. Just zero.

The class is instantiated, it is showing in the view, so I'm pretty sure it's not a nil reference.

I've searched all over Google and can't figure it out.

What's going on?!?

:(

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c