2013-10-22 38 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中,然後這個推送就可以工作。