-1

嗨,我不断收到线程错误。我制作了一个非常简单的故事板,它有两个屏幕。第一个有一个通向第二个的按钮。当我运行应用程序并单击按钮时,它会因线程错误而崩溃。我并不是每个人都写过任何代码,还只是在故事板上工作。如果您能告诉我是什么原因造成的,或者我可以锻炼导致它的原因,因为我无法理解线程调试错误。

2013-10-10 20:18:54.249 引用 [851:a0b] * 由于未捕获的异常“NSGenericException”而终止应用程序,原因:“只有在源控制器由 UINavigationController 的实例管理时才能使用推送序列。” *第一次抛出调用堆栈:( 0 CoreFoundation 0x017475e4exceptionPreprocess + 180 1 libobjc.A.dylib 0x014b68b6 objc_exception_throw + 44 2 UIKit 0x0076c605 -[UIStoryboardPushSegue destinationContainmentContext] + 0 3 UIKit 0x0075c9de -[UIStoryboardSegueTemplate _perform:] + 174 4 UIKit 0x0075ca59 -[UIStoryboardSegueTemplate perform:] + 115 5 libobjc.A. dylib 0x014c8874 -[NSObject performSelector:withObject:withObject:] + 77 6 UIKit 0x0022ac8c -[UIApplication sendAction:to:from:forEvent:] + 108 7 UIKit 0x0022ac18 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61 8 UIKit 0x003226d9 -[UIControl 发送动作:到:forEvent:] + 66 9 UIKit 0x00322a9c -[UIControl _sendActionsForEvents:withEvent:] + 577 10 UIKit 0x00321d4b -[UIControl touchesEnded:withEvent:] + 641 11 UIKit 0x002680cd -[UIWindow _sendTouchesForEvent:] + 852 12 UIKit 0x002[UIKit 0x006] ] + 1232 13 UIKit 0x0023ca36 -[UIApplication sendEvent:] + 242 14 UIKit 0x00226d9f _UIApplicationHandleEventQueue + 11421 15 CoreFoundation 0x016d08af __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION] + 577 10 UIKit 0x00321d4b -[UIControl touchesEnded:withEvent:] + 641 11 UIKit 0x002680cd -[UIWindow _sendTouchesForEvent:] + 852 12 UIKit 0x00268d34 -[UIWindow sendEvent:] + 1232 13 UIKit 0x0023ca36 -[14 应用程序发送事件: UIKit 0x00226d9f _UIApplicationHandleEventQueue + 11421 15 CoreFoundation 0x016d08af __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION] + 577 10 UIKit 0x00321d4b -[UIControl touchesEnded:withEvent:] + 641 11 UIKit 0x002680cd -[UIWindow _sendTouchesForEvent:] + 852 12 UIKit 0x00268d34 -[UIWindow sendEvent:] + 1232 13 UIKit 0x0023ca36 -[14 应用程序发送事件: UIKit 0x00226d9f _UIApplicationHandleEventQueue + 11421 15 CoreFoundation 0x016d08af __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION] + 1232 13 UIKit 0x0023ca36 -[UIApplication sendEvent:] + 242 14 UIKit 0x00226d9f _UIApplicationHandleEventQueue + 11421 15 CoreFoundation 0x016d08af __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION] + 1232 13 UIKit 0x0023ca36 -[UIApplication sendEvent:] + 242 14 UIKit 0x00226d9f _UIApplicationHandleEventQueue + 11421 15 CoreFoundation 0x016d08af __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION+ 15 16 CoreFoundation 0x016d023b __CFRunLoopDoSources0 + 235 17 CoreFoundation 0x016ed30e __CFRunLoopRun + 910 18 CoreFoundation 0x016ecb33 CFRunLoopRunSpecific + 467 19 CoreFoundation 0x016ec94b CFRunLoopRunInMode + 123 20 GraphicsServices 0x036849d7 GSEventRunModal + 192 21 GraphicsServices 0x036847fe GSEventRun + 104 22 UIKit 0x0022994b UIApplicationMain + 1225 23 Quote 0x0000217d main + 141 24 libdyld.dylib 0x01d6f725 开始 + 0 25 ??? 0x00000001 0x0 + 1 ) libc++abi.dylib: 以 NSException (lldb) 类型的未捕获异常终止

4

1 回答 1

2

“'Push segues 只能在源控制器由 UINavigationController 的实例管理时使用。”

那是你的问题,Push Segues 只能与 UINavigationController 一起使用。要将您的第一个视图控制器放入导航控制器,请单击您的第一个视图控制器,然后单击编辑器 > 嵌入 > 导航控制器。

于 2013-10-10T19:23:10.520 回答