How to multiply two text field float values and automatically update it in the third one in iphone?
I am getting warning: local declaration of ‘distance’ hides instance variables
$
-(void)textFieldDidEndEditing:(UITextField *)textField{
double distance = [self.distance.text doubleValue];
double mileage = [self.mileagerate.text doubleValue];
amount.text = [NSString stringWithFormat:@"%.2f",distance * mileage];
}
The warning is because you have a text field named distance an a local variable also named distance. Rename your local variable and the warning should go away: