简体   繁体   English

嵌入式控制器没有插座

[英]Embedded controller has nil outlets

In the storyboard, I embedded controller B into controller A. However when I try to access the outlets in controller B from controller B's viewDidLoad, viewWillAppear, or viewDidAppear methods, they're nil. 在情节提要中,我将控制器B嵌入到控制器A中。但是,当我尝试控制器B的viewDidLoad,viewWillAppear或viewDidAppear方法访问控制器B中的插座时,它们为空。

Why would an embedded controller's own outlets be nil after the view has loaded? 视图加载后,为什么嵌入式控制器自己的插座为零?

You are building your LiveView controls in a storyboard scene that's not being used. 您正在未使用的故事板场景中构建LiveView控件。 Move your various views and buttons into the scene that's connected to your container view by the embed segue. 将您的各种视图和按钮移动到通过嵌入segue连接到容器视图的场景中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM