1. 程式人生 > >loaded the "BlueView" nib but the view outlet was not set 錯誤的解決辦法。

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

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

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和檢視做個關聯