- (IBAction)Save:(id)sender {
NSString *saveString = taskName.text;
NSUserDefaults *defults = [NSUserDefaults standardUserDefaults];
[defults setObject:saveString forKey:@"savedString"];
[defults synchronize];
//use data that has been given
}
- (IBAction)theTask:(id)sender {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *loadstring = [defaults objectForKey:@"savedString"];
[taskName setText:loadstring];
[super viewDidLoad];
}
我试图将我在故事板上制作的新标签附加到theTask方法。因此,当用户键入任务并按下保存时,任务将被放置在其他任务列表中