I've tried to convert the UITextfield Value Into a float first then convert it to an NSNumber but that doesn't seem to work as seen below.
float carb = [self.carbGrams.text floatValue];
NSLog(@"%.2f", carb);
nCarbGrams = carb;
In the last line I get this error message:
Assigning to 'NSNumber *__strong' from incompatible type 'float'
I've then just tried assigning carb as an NSNumber by doing this
NSNumber *carb = [self.carbGrams.text floatValue];
NSLog(@"%.2f", carb);
nCarbGrams = carb;
But I get this error message instead :
Initializing 'NSNumber *__strong' with an expression of incompatible type 'float'
As I've read I though NSNumber could accept any type of numeric value but I seem to be incorrect, can someone please evaluate the problem?