2016-08-23 100 views
0

我在我的代碼中得到一個sigabrt錯誤,我無法解決它。我嘗試了幾個選擇,但都是徒勞的。線程1:信號SIGABRT錯誤

那裏正在錯誤的代碼是

class AppDelegate: UIResponder, UIApplicationDelegate { 

var window: UIWindow? 

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool { 

    UINavigationBar.appearance().tintColor = UIColor.whiteColor() 
    UINavigationBar.appearance().barTintColor = UIColor(red: 0.66, green: 0.78, blue: 0.31, alpha: 1) 
    UIButton.appearance().tintColor = UIColor(red: 0.88, green: 0.53, blue: 0.21, alpha: 1) 

    return true 

該控制檯顯示此錯誤

*2016-08-23 20:37:24.081 to-do list[35600:1421134] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported' 
*** First throw call stack: 
(
    0 CoreFoundation      0x0068aa94 __exceptionPreprocess + 180 
    1 libobjc.A.dylib      0x02424e02 objc_exception_throw + 50 
    2 UIKit        0x01214a0e __71-[UINavigationController pushViewController:transition:forceImmediate:]_block_invoke + 0 
    3 UIKit        0x01213e27 __54-[UINavigationController pushViewController:animated:]_block_invoke + 351 
    4 UIKit        0x01213c83 -[UINavigationController pushViewController:animated:] + 786 
    5 UIKit        0x01213f0e __54-[UINavigationController pushViewController:animated:]_block_invoke1548 + 52 
    6 UIKit        0x01aed0ce -[_UIViewControllerTransitionCoordinator _applyBlocks:releaseBlocks:] + 292 
    7 UIKit        0x01ae8d82 -[_UIViewControllerTransitionContext _runAlongsideCompletions] + 147 
    8 UIKit        0x01ae8a6d -[_UIViewControllerTransitionContext completeTransition:] + 136 
    9 UIKit        0x00fe963e __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke93 + 879 
    10 UIKit        0x010bdc64 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 647 
    11 UIKit        0x010983c7 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 247 
    12 UIKit        0x010987bd -[UIViewAnimationState animationDidStop:finished:] + 90 
    13 QuartzCore       0x04baee97 _ZN2CA5Layer23run_animation_callbacksEPv + 305 
    14 libdispatch.dylib     0x02e789cd _dispatch_client_callout + 14 
    15 libdispatch.dylib     0x02e5e018 _dispatch_main_queue_callback_4CF + 910 
    16 CoreFoundation      0x005dc70e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14 
    17 CoreFoundation      0x0059a454 __CFRunLoopRun + 2356 
    18 CoreFoundation      0x00599866 CFRunLoopRunSpecific + 470 
    19 CoreFoundation      0x0059967b CFRunLoopRunInMode + 123 
    20 GraphicsServices     0x054a8664 GSEventRunModal + 192 
    21 GraphicsServices     0x054a84a1 GSEventRun + 104 
    22 UIKit        0x01003cc1 UIApplicationMain + 160 
    23 to-do list       0x000ca10c main + 140 
    24 libdyld.dylib      0x02ea2a21 start + 1 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 
(lldb)* 

回答

3

的錯誤不是你上面貼的代碼。在控制檯消息它指出:

「推導航控制器,不支持」

檢查你的故事板文件,以確保一切都設置正確。

+1

嘿謝謝..我明白了:) – Radz

+0

@Radz如果這解決了你的問題,你可以接受這個答案! – random

+0

我做了:)非常感謝 – Radz