【发布时间】:2018-11-24 18:06:26
【问题描述】:
我在导航控制器中嵌入了一个目标视图控制器,但现在无法将变量传递给它。
我的代码是:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
//THis is the navigation controller
UIViewController *destVC = [storyboard instantiateViewControllerWithIdentifier:@"myNav"];
//This is the view controller embedded in the nav
IDNowVC* myVC = [storyboard instantiateViewControllerWithIdentifier:@"myVC"];
myVC.sender = @1;//for contacts
[self presentViewController:destVC animated:YES completion:nil];
VC启动后,sender属性为nil。它没有得到@1 的值。
我错过了什么?
感谢您的任何建议。
【问题讨论】:
标签: ios uiviewcontroller parameter-passing