我正在使用 Storyboard instantiateViewControllerWithIdentifier: 并且我注意到我连接的所有 IBOutlets 仍然为零。但是,我连接的 IBActions 可以正常工作。 View 和 Controller 是链接的(即 controller.view 不是 nil),如果我显示 View ,它会显示我所期望的内容。
我错过了什么?
这是我的设置:
instantiateViewControllerWithIdentifier:IBOutlets 和 IBActions。最佳答案
View 似乎只有在第一次访问后才正确初始化。调用时问题消失
[self presentViewController:vc animated:NO completion:nil];
或者更简单的说
[vc view];
关于ios - Storyboard instantiateViewControllerWithIdentifier 不设置 IBOutlets,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12523198/