Hello I am trying to set the user input from a UITextField set to Decimal Pad to have a float equal to that amount.
//
// ViewController.h
// tiptest
//
// Created by NUGZ on 1/23/14.
// Copyright (c) 2014 NUGZ. All rights reserved.
//
#import <UIKit/UIKit.h>
float tipAmount1;
float tipAmount2;
float tipAmount3;
float tipAmount4;
@interface ViewController : UIViewController {
IBOutlet UITextField *tip1;
IBOutlet UITextField *tip2;
IBOutlet UITextField *tip3;
IBOutlet UITextField *tip4;
IBOutlet UILabel *total;
}
-(IBAction)tally:(id)sender;
@end
In the implementation file I have tried doing the following:
- (void)viewDidLoad
{
tipAmount1 = [tip1 floatValue];
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
But it is telling me "No visible @interface for 'UITextField' declares the selector 'floatValue'. Any ideas? I am trying to eventually make it so I can have multiple UITextFields that take the input into floats and then add all the floats for a total.