我創建了三個文件SettingsViewController.h,SettingsViewController.m和SettingsViewController.xib。這個類是不符合編碼的關鍵值
我在單擊一行中的單元格時顯示了SwttingsViewController.xib。 xib文件上有一個標籤和滑塊。它工作正常。但是在使用接口構建器創建連接之後。即從redLabel插座拖放到我的Xib文件上的標籤我得到這個錯誤和應用程序終止。
'[<UIViewController 0x3d636d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key redLabel.
'
我在界面構建器中指向正確的文件。它給我同樣的錯誤,我的文件所有者的類型是空的或SettingsViewController。 – coure2011 2010-06-23 09:30:24
是的你是對的,在代碼我沒有正確啓動控制器。我正在這樣做(錯誤) controller = [[UIViewController alloc] initWithNibName:@「SettingsViewController」bundle:nil]; – coure2011 2010-06-23 09:39:57
它應該是 controller = [[SettingsViewController alloc] initWithNibName:@「SettingsViewController」bundle:nil]; – coure2011 2010-06-23 09:40:34