我有一個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
可以發表你的例子有問題的代碼? –