鍍金池/ 問答/PHP  C  iOS  網(wǎng)絡(luò)安全/ iOS present viewcontroller 崩潰問題

iOS present viewcontroller 崩潰問題

圖片描述

如上圖,我在XCode中創(chuàng)建了三個文件,這三個文件都沒有額外添加任何代碼。我在另一個 VC 中實例化TestViewController后,然后 present 這個 vc 就會崩潰。崩潰信息如下:

圖片描述

然而我的 TestViewController 和 TestView 并沒有任何聯(lián)系,是蘋果的 Bug 還是背后什么機制的問題?菜鳥求問^_^

回答
編輯回答
故林

UIViewController loaded the 'TestView.xib', but the Controller's view outlet was not set
你的TestViewController是通過loadNib方式創(chuàng)建的, 而系統(tǒng)在xib中沒有找到能關(guān)聯(lián)到Controller的View.
檢查一下TestViewController的創(chuàng)建方式及TestView.xib的Class是否關(guān)聯(lián)了Controller, Controller的xib必須要關(guān)聯(lián)View.

2018年1月11日 17:47