天天看點

loaded the "BlueView" nib but the view outlet was not set 錯誤的解決辦法。

一般這種情況是建立檔案的忘記同時建立xib檔案, 後來又單獨給檔案關聯xib檔案, 但是關聯不正确出現的問題

今天在做練習建立多個視圖程式的時候,老是出現下面這樣的錯誤:

p.p1 {margin: 0.0px 0.0px 0.0px 28.0px; text-indent: -28.0px; font: 11.0px Menlo}

'-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "BlueView" nib but the view outlet was not set.'

查書才知道,沒有做nib檔案到xxxViewControler程式的關聯,特此記錄下來:

1, 打開nib檔案

2, 點選"File's Owner", 按command+4,設定Class為xxxViewControler

3, 按Control+"Files's Owner", 裡面有個預設的IBOutlet變量view, 看一下後面有沒有做關聯,如果沒有就拉到下面的View和視圖做個關聯

loaded the "BlueView" nib but the view outlet was not set 錯誤的解決辦法。
loaded the "BlueView" nib but the view outlet was not set 錯誤的解決辦法。

轉載自:http://blog.csdn.net/leonpengweicn/article/details/6022616