如何使此保存按钮将输入的文本保存到新页面?

时间:2013-11-23 16:36:09

标签: ios objective-c nsuserdefaults

- (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方法。因此,当用户键入任务并按下保存时,任务将被放置在其他任务列表中

0 个答案:

没有答案