UIViewController崩溃了新的segue?

时间:2013-10-22 17:14:39

标签: iphone objective-c xcode uiviewcontroller segue

我在故事板中连接了许多segue中的一个。我终于厌倦了,把一个空的UIViewController拖到我的故事板上,并通过push segue连接了一个按钮。没有方法,代理,操作,附加到所述按钮或视图,但我无法进行转换。

这是堆栈:

2013-10-22 13:11:10.070 Party Prioritizer[5445:a0b] -[UIViewController setDelegate:]: unrecognized selector sent to instance 0xa260020
2013-10-22 13:11:10.073 Party Prioritizer[5445:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController setDelegate:]: unrecognized selector sent to instance 0xa260020'
*** First throw call stack:
(
    0   CoreFoundation                      0x01a7c5e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x0177d8b6 objc_exception_throw + 44
    2   CoreFoundation                      0x01b19903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
    3   CoreFoundation                      0x01a6c90b ___forwarding___ + 1019
    4   CoreFoundation                      0x01a6c4ee _CF_forwarding_prep_0 + 14
    5   Party Prioritizer                   0x0002f81c -[WeddingViewController prepareForSegue:sender:] + 236
    6   UIKit                               0x00a239cc -[UIStoryboardSegueTemplate _perform:] + 156
    7   UIKit                               0x00a23a59 -[UIStoryboardSegueTemplate perform:] + 115
    8   libobjc.A.dylib                     0x0178f874 -[NSObject performSelector:withObject:withObject:] + 77
    9   UIKit                               0x004f1c8c -[UIApplication sendAction:to:from:forEvent:] + 108
    10  UIKit                               0x004f1c18 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
    11  UIKit                               0x005e96d9 -[UIControl sendAction:to:forEvent:] + 66
    12  UIKit                               0x005e9a9c -[UIControl _sendActionsForEvents:withEvent:] + 577
    13  UIKit                               0x005e8d4b -[UIControl touchesEnded:withEvent:] + 641
    14  UIKit                               0x0052f0cd -[UIWindow _sendTouchesForEvent:] + 852
    15  UIKit                               0x0052fd34 -[UIWindow sendEvent:] + 1232
    16  UIKit                               0x00503a36 -[UIApplication sendEvent:] + 242
    17  UIKit                               0x004edd9f _UIApplicationHandleEventQueue + 11421
    18  CoreFoundation                      0x01a058af __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
    19  CoreFoundation                      0x01a0523b __CFRunLoopDoSources0 + 235
    20  CoreFoundation                      0x01a2230e __CFRunLoopRun + 910
    21  CoreFoundation                      0x01a21b33 CFRunLoopRunSpecific + 467
    22  CoreFoundation                      0x01a2194b CFRunLoopRunInMode + 123
    23  GraphicsServices                    0x031899d7 GSEventRunModal + 192
    24  GraphicsServices                    0x031897fe GSEventRun + 104
    25  UIKit                               0x004f094b UIApplicationMain + 1225
    26  Party Prioritizer                   0x0001c46d main + 141
    27  libdyld.dylib                       0x02e79725 start + 0
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

任何想法为什么我的其他50个segue的工作,但我不能因某种原因得到这个空白的工作?

2 个答案:

答案 0 :(得分:1)

带有按钮(WeddingViewController)的视图控制器正在实施prepareForSegue:sender:。可能在该方法中,您没有检查segue标识符。无论如何,在该方法的某个时刻,您正在设置一个视图控制器的委托,该控制器没有委托并且导致您的崩溃。

答案 1 :(得分:0)

你无法推入ViewController ...你应该将它嵌入到NavigationController中,然后推送就可以了。