これは昨日の質問のフォローアップです。私の .h は
@property (weak, nonatomic) IBOutlet UITextField *initialBudget;
@property (weak, nonatomic) IBOutlet UITextField *expenses;
@property (weak, nonatomic) IBOutlet UITextField *timeSpent;
@property (weak, nonatomic) IBOutlet UITextField *incomePerHour;
私の.mは:
- (IBAction)calculateResults:(id)sender {
double budget = [initialBudget.text doubleValue ];
double expense = [expenses.text doubleValue];
double time = [timeSpent.text doubleValue];
double hourlyIncome = (budget - expense)/time;
incomePerHour.text = [NSString stringWithFormat:@"%.2f", hourlyIncome];
}
さまざまな方法を使用してテキストをViewControllerに保存しようとしましたが、アプリを閉じるとテキストが消えます。誰にもアイデアがありますか?私は夏の初めから Objective-C を勉強しているだけなので、潜在的な初心者の質問についてお詫び申し上げます。