Hi.
I want to display in my apps view the results of a calculation, in a UILabel.
The calculations are being handled as floats. The error I am getting is
"Incompatible type for argument 1 of setText:"
What am I doing wrong... I know it is related to mishandling of the variable type. How do I get the float to display in the UILabel as xx.x (one digit after the decimal?).
Thanks!
I want to display in my apps view the results of a calculation, in a UILabel.
The calculations are being handled as floats. The error I am getting is
"Incompatible type for argument 1 of setText:"
What am I doing wrong... I know it is related to mishandling of the variable type. How do I get the float to display in the UILabel as xx.x (one digit after the decimal?).
Code:
-(BOOL) textFieldShouldReturn: (UITextField *) textFeildA{
[textFeildA resignFirstResponder];
if (moveViewUp) [self scrollTheView:NO];
float a = [textFieldA.text floatValue];
float b = [textFieldB.text floatValue];
float fy = a / b;
[self updateDisplay:fy];
return YES;
}
- (IBAction) updateDisplay: (float) e
{
[labelAoverB setText: e];
}
Thanks!