I am having a really odd problem trying to set a simple float value to 1.
My property:
{
float direction;
}
@property(nonatomic)float direction;
Which is synthesized:
@synthesize direction;
I then used the following code:
- (void)setDirection:(float)_direction {
NSLog(@"Setter called with value of %f",_direction);
self->direction = _direction;
}
For testing purposes...
When I try to change the value with this,
[[w getCharacter] setDirection:1.0f];
where [w getCharacter]
gives this:
return [[[self scene] gameLayer] player];
I get the warning, "setDirection
not defined."
If I switch to dot notation([w getCharacter].direction
), I get "confused by earlier errors, bailing out".
Here is where the weirdness starts. When I try to change the value, the debug message displays _direction = 0.00000
. When I check the number later, its still 0.000. I am clearly trying to change it to 1, why is this not working?