我的代码中出现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)*
答案 0 :(得分:3)
错误不在您上面发布的代码中。在控制台消息中,它声明:
'不支持推送导航控制器'
检查故事板文件以确保一切设置正确。