2012-11-28 24 views
3

我不斷收到此異常在XcodeiPhone應用在iOS未知的密鑰例外

2012-11-27 23:42:51.239 MichaelWidickProject[9640:c07] Application windows are expected to have a root view controller at the end of application launch 
2012-11-27 23:42:52.825 MichaelWidickProject[9640:c07] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<InheritController 0x8e40cc0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key you.' 
*** First throw call stack: 
(0x1c93012 0x10d0e7e 0x1d1bfb1 0xb7d711 0xafeec8 0xafe9b7 0xb29428 0x2350cc 0x10e4663 0x1c8e45a 0x233bcf 0xf8e37 0xf9418 0xf9648 0xf9882 0xf9b2a 0x110ef5 0x110fdb 0x111286 0x111381 0x111eab 0x111fc9 0x112055 0x2173ab 0x6892d 0x10e46b0 0x228ffc0 0x228433c 0x2284150 0x22020bc 0x2203227 0x22038e2 0x1c5bafe 0x1c5ba3d 0x1c397c2 0x1c38f44 0x1c38e1b 0x1bed7e3 0x1bed668 0x1865c 0x1f6d 0x1e95) 
libc++abi.dylib: terminate called throwing an exception 

我想點擊一個按鈕,然後使按鈕推視圖控制器到導航視圖控制器。我嘗試了所有我能想到的。 這是如此奇怪,我的教授無法弄清楚。請幫助

InheritController *gameOne = [[InheritController alloc] initWithNibName:@"BasicMathLevelOne" bundle:nil]; 
gameOne.title = @"Level One:Basic Game"; 
[self.navigationController pushViewController:gameOne animated:NO]; 
+0

你有行''窗口makeKeyAndVisible];'在你的App委託的'applicationDidFinishLaunching'函數中?假設你將View Controller添加到'window'('UIWindow') – Raptor

回答

1

錯誤消息聽起來像是「BasicMathLevelOne.xib」中斷開的連接。這是KVC試圖爲您的InheritController上的關鍵字「你」設置一個值的結果,但該類沒有符合KVC的訪問器(更多?)。要找到發生錯誤的確切位置,請在Xcode中設置異常斷點(按下Command-6,單擊左下角的「+」,選擇「添加異常斷點」)。在調試器中運行應用程序應該使其停在發生錯誤的地方。

哦,還有另一位教授。