Tuesday, 13 August 2013

saving the UITextField

saving the UITextField

this is a follow up from my question yesterday my .h is
@property (weak, nonatomic) IBOutlet UITextField *initialBudget;
@property (weak, nonatomic) IBOutlet UITextField *expenses;
@property (weak, nonatomic) IBOutlet UITextField *timeSpent;
@property (weak, nonatomic) IBOutlet UITextField *incomePerHour;
my .m is:
- (IBAction)calculateResults:(id)sender {
double budget = [initialBudget.text doubleValue ];
double expense = [expenses.text doubleValue];
double time = [timeSpent.text doubleValue];
double hourlyIncome = (budget - expense)/time;
NSNumber *resultNumber = [[NSNumber alloc] initWithDouble:hourlyIncome];
incomePerHour = resultNumber;
}
Ive tried using different methods to keep the text saved but nothing has
worked. Anyone have an idea? Ive only been studying Objective-C since the
beginning of the summer so my apologies for the potential newbie
questions.

No comments:

Post a Comment