所以我能够将数据从第一个视图传输到第二个视图,如下所示:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"Check Mark Segue"])
{
NSLog(@"Transfering Data");
AutoRenewDrop *controller = segue.destinationViewController;
controller.transferData = self.renewDate.text;
}
}
但是,当用户点击完成并且 transferData 工作正常但 renewDate.text 没有改变时,我尝试将新值传输回 renewDate.text 。这是我用来传回数据的代码:
-(IBAction)done:(UIStoryboardSegue *)segue {
[self.navigationController popViewControllerAnimated:YES];
AddR *add = [[AddR alloc] init];
add.renewDate.text = transferData;
}
有人可以告诉我如何解决这个问题吗?