2014-03-29 21 views
0

運行我的應用程序後,我在AppDelegate.h中收到此錯誤消息。 「線程1:信號SIGABRT」我已經評論了錯誤發生在我的代碼的一側。任何人都可以幫忙嗎?謝謝。線程1:signal SIGABRT有人可以幫我嗎?

#import <UIKit/UIKit.h> 

#import "AppDelegate.h" 

int main(int argc, char * argv[]) 
{ 
    @autoreleasepool { 
     return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); //Thread 1: signal SIGABRT 
    } 
} 

這裏是堆棧跟蹤我越來越:

2014-03-29 17:27:56.440 Game[3599:70b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x109c28520> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.' 
*** First throw call stack: 
(
    0 CoreFoundation      0x0000000101c1b795 __exceptionPreprocess + 165 
    1 libobjc.A.dylib      0x0000000101725991 objc_exception_throw + 43 
    2 CoreFoundation      0x0000000101c9fe69 -[NSException raise] + 9 
    3 Foundation       0x000000010130703a -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259 
    4 CoreFoundation      0x0000000101c17700 -[NSArray makeObjectsPerformSelector:] + 224 
    5 UIKit        0x00000001005d11b8 -[UINib instantiateWithOwner:options:] + 1131 
    6 UIKit        0x00000001005d2bb2 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 138 
    7 UIKit        0x000000010038781d -[UIApplication _loadMainNibFileNamed:bundle:] + 42 
    8 UIKit        0x0000000100386b1a -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 454 
    9 UIKit        0x0000000100397aab -[UIApplication handleEvent:withNewEvent:] + 3092 
    10 UIKit        0x0000000100397f1e -[UIApplication sendEvent:] + 79 
    11 UIKit        0x00000001003882be _UIApplicationHandleEvent + 618 
    12 GraphicsServices     0x0000000104977bb6 _PurpleEventCallback + 762 
    13 GraphicsServices     0x000000010497767d PurpleEventCallback + 35 
    14 CoreFoundation      0x0000000101b9d819 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41 
    15 CoreFoundation      0x0000000101b9d5ee __CFRunLoopDoSource1 + 478 
    16 CoreFoundation      0x0000000101bc6ab3 __CFRunLoopRun + 1939 
    17 CoreFoundation      0x0000000101bc5f33 CFRunLoopRunSpecific + 467 
    18 UIKit        0x00000001003864bd -[UIApplication _run] + 609 
    19 UIKit        0x0000000100388043 UIApplicationMain + 1010 
    20 Game        0x0000000100000f33 main + 115 
    21 libdyld.dylib      0x00000001032755fd start + 1 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 
+0

添加一個異常斷點,這可能會讓您更多地指出錯誤實際發生的位置。看看xcode屏幕左側的調用堆棧,這也會給你一個更好的指示。 – Pruthvikar

+0

這是一個後續問題到這個[這裏](http://stackoverflow.com/questions/22737673/missing-at-start-of-message-send-expression)?如果是這樣,你能否在這裏發佈你在那裏發佈的堆棧跟蹤? – Alfonso

+0

我不知道堆棧跟蹤是什麼。是的,這是一個後續行動。抱歉,我是xcode的新手我已經嘗試過研究所有內容,但是我仍然沒有找到解決方案。 – user3466875

回答

0
Game[3599:70b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x109c28520> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.' 

上面一行意味着你試圖訪問一個屬性調用視圖,但你的類沒有這個名字的一個屬性。您可以在實際上沒有視圖的對象上調用view屬性(但這很可能會被編譯器捕獲),或者您沒有在Interface Builder中爲視圖控制器設置視圖插座。

檢查您在App Delegate中加載的視圖控制器是否在IB中連接了視圖插座。

+1

其實基於錯誤消息它不是類'遊戲'但是'UIApplication'類。遊戲似乎是應用程序的名稱。 – Alfonso

+0

是的,你是對的。編輯我的迴應。 – jancakes