I have the following custom object:
@interface LoadDescription : NSObject
@property (nonatomic) float start, stop, startMagnitude, stopMagnitude;
@end
I have the object in one of my controllers as a property:
@property (nonatomic, strong) LoadDescription *editingLoad;
But when I try to set/get the properties within the editingLoad property...
float tableValue = [textField.text floatValue];
NSLog(@"value in table is %f", tableValue);
self.editingLoad.startMagnitude = tableValue;
NSLog(@"Load magnitude is %i", (int)self.editingLoad.startMagnitude);
...and run iOS, the console output shows that while tableValue is whatever I input it as, self.editingLoad.startMagnitude is always 0.00000000, which makes me think that something's wrong with the setter/getter.
I am running ARC, if that's relevant.
Any help is appreciated, thanks in advance!
Is the editingLoad object alloc’d and init’d prior to the property assignment?
If not that may be your problem, else if you are type cast int to float that is less than 1 i believe it will always be zero. I don’t know what values you are expecting from the “tableValue”
What happens when the second log prints out a float/double “%f” ?