2013-12-14 45 views
0

我使用Apple的示例文件的'Detail - Master Application'。由於SIGABRT發生,我的應用程序崩潰

我編輯了它的'Main-iPhone.storyboard'就像這張圖片。

Main-iPhone.storyboard

而且這個錯誤發生在我的應用程序。

2013-12-14 15:13:12.960 IFST[2448:70b] -[UITabBarController topViewController]: unrecognized selector sent to instance 0x8a6c290 
2013-12-14 15:13:12.963 IFST[2448:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITabBarController topViewController]: unrecognized selector sent to instance 0x8a6c290' 
*** First throw call stack: 
(
    0 CoreFoundation      0x01aa15e4 __exceptionPreprocess + 180 
    1 libobjc.A.dylib      0x018248b6 objc_exception_throw + 44 
    2 CoreFoundation      0x01b3e903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275 
    3 CoreFoundation      0x01a9190b ___forwarding___ + 1019 
    4 CoreFoundation      0x01a914ee _CF_forwarding_prep_0 + 14 
    5 IFST        0x00004d40 -[AppDelegate application:didFinishLaunchingWithOptions:] + 848 
    6 UIKit        0x0058c355 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 309 
    7 UIKit        0x0058cb95 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1536 
    8 UIKit        0x005913a8 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824 
    9 UIKit        0x005a587c -[UIApplication handleEvent:withNewEvent:] + 3447 
    10 UIKit        0x005a5de9 -[UIApplication sendEvent:] + 85 
    11 UIKit        0x00593025 _UIApplicationHandleEvent + 736 
    12 GraphicsServices     0x039042f6 _PurpleEventCallback + 776 
    13 GraphicsServices     0x03903e01 PurpleEventCallback + 46 
    14 CoreFoundation      0x01a1cd65 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53 
    15 CoreFoundation      0x01a1ca9b __CFRunLoopDoSource1 + 523 
    16 CoreFoundation      0x01a4777c __CFRunLoopRun + 2156 
    17 CoreFoundation      0x01a46ac3 CFRunLoopRunSpecific + 467 
    18 CoreFoundation      0x01a468db CFRunLoopRunInMode + 123 
    19 UIKit        0x00590add -[UIApplication _run] + 840 
    20 UIKit        0x00592d3b UIApplicationMain + 1225 
    21 IFST        0x0000592d main + 141 
    22 libdyld.dylib      0x020df70d start + 1 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 
(lldb) 

和SIGABRT。

爲什麼發生了呢?

請告訴我。

回答

0

你的崩潰日誌給你答案:

2013-12-14 15:13:12.963 IFST[2448:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITabBarController topViewController]: unrecognized selector sent to instance 0x8a6c290' 

某處你發送topViewController標籤欄控制器。這不是導航控制器,所以這種方法是不合適的。也許selectedViewController是你正在尋找的。

+0

謝謝。但我沒有編輯它的代碼。 – Rukkora

+0

我該如何解決? – Rukkora

+0

您應該重新審視將您的導航控制器添加到故事板的方式。我認爲問題在於此。 – Alexander

相關問題