2013-10-22 114 views
0

我在故事板中连接了很多segue中的一个。我终于厌倦了,并将一个空的UIViewController拖放到我的故事板上,并通过push segue将一个按钮连接到它。没有方法,委托,操作,附加到所述按钮或视图,但我无法获得转换发生。UIViewController在新的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赛格瑞的工作,但我不能因为某些原因得到这个空白的工作?

+0

这是线程列表:http://i.imgur.com/Y2wIZiw.png – Anthony

+0

添加您的代码。我认为你将代理设置为没有委托属性的视图 –

+0

我所做的只是将一个按钮拖动到一个视图上,将一个新的uiviewcontroller拖动到屏幕上,并在按钮和控制器之间创建一个push segue。 – Anthony

回答

1

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

0

你不能推到一个ViewController上......你应该将它嵌入到一个NavigationController中,然后这个推送就可以工作。