我有一个UIViewcontroller
里面有一个容器视图。在storyboard
中,容器视图通过Embed Segue与UIViewcontroller
连接。我不需要将ParentView Controller
中的数据传递给子视图控制器。 ChildViewController
有CustomViewController
类,但由于我不需要在两个视图控制器之间传递任何数据,所以它们之间的唯一参考是嵌入在Storyboard
中的segue。Swift中的容器视图控制器应用崩溃NSInternalInconsistencyException?
每次我打开父视图控制器,应用程序崩溃,并出现以下错误:
*** Terminating app due to uncaught exception 'NSInternalIncosistencyException', reason: 'NSDictionaryOfVariableBindings failed bacause either one of the values is nil, or there's something wrong with the way the macro is being invoked. Cannot assign value nil for key "childView". Keys:( childView )'
任何想法是什么原因造成这种错误,以及如何解决这一问题?我正在使用Xcode 8.1和Swift 3
'ChildViewController.view'是'nil' – shallowThought
可以发表你的例子有问题的代码? –