我使用此代码它工作正常,但不是我想要的方式。我不希望这个IBAction
带我到第二个View Controller我只想将它保存到第二个View Controller。
- (IBAction)passtexttovc2:(id)sender {
ViewController2 *vc2 =[self.storyboard instantiateViewControllerWithIdentifier:@"ViewController2"];
vc2.stringfromteztfield1= self.Actionforbutton.text;
[self presentViewController:vc2 animated:YES completion:NO];
}
答案 0 :(得分:-1)
删除
[self presentViewController:vc2 animated:YES completion:NO];
只在你想要的时候出现。
答案 1 :(得分:-1)
此处不需要presentViewController
方法。你不需要出席'这里的视图控制器本身。
答案 2 :(得分:-1)