快速自定义segue和自定义展开segue

时间:2015-06-22 21:03:58

标签: swift unwind-segue

我已经使用swift在示例应用中实现了自定义segue和自定义展开segue。自定义segue工作正常但自定义展开segue会出现以下错误:

2015-06-22 21:05:58.929 Test_Segue[7162:336393] -[__NSSetM perform:]: unrecognized selector sent to instance 0x7ffc89c190c0
2015-06-22 21:05:58.933 Test_Segue[7162:336393] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSSetM perform:]: unrecognized selector sent to instance 0x7ffc89c190c0'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010d27bc65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000010b228bb7 objc_exception_throw + 45
    2   CoreFoundation                      0x000000010d2830ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x000000010d1d913c ___forwarding___ + 988
    4   CoreFoundation                      0x000000010d1d8cd8 _CF_forwarding_prep_0 + 120
    5   UIKit                               0x000000010b46bda2 -[UIApplication sendAction:to:from:forEvent:] + 75
    6   UIKit                               0x000000010b57d54a -[UIControl _sendActionsForEvents:withEvent:] + 467
    7   UIKit                               0x000000010b57c919 -[UIControl touchesEnded:withEvent:] + 522
    8   UIKit                               0x000000010b4b8998 -[UIWindow _sendTouchesForEvent:] + 735
    9   UIKit                               0x000000010b4b92c2 -[UIWindow sendEvent:] + 682
    10  UIKit                               0x000000010b47f581 -[UIApplication sendEvent:] + 246
    11  UIKit                               0x000000010b48cd1c _UIApplicationHandleEventFromQueueEvent + 18265
    12  UIKit                               0x000000010b4675dc _UIApplicationHandleEventQueue + 2066
    13  CoreFoundation                      0x000000010d1af431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    14  CoreFoundation                      0x000000010d1a52fd __CFRunLoopDoSources0 + 269
    15  CoreFoundation                      0x000000010d1a4934 __CFRunLoopRun + 868
    16  CoreFoundation                      0x000000010d1a4366 CFRunLoopRunSpecific + 470
    17  GraphicsServices                    0x000000010eeb4a3e GSEventRunModal + 161
    18  UIKit                               0x000000010b46a900 UIApplicationMain + 1282
    19  Test_Segue                          0x000000010acd8e87 main + 135
    20  libdyld.dylib                       0x000000010df33145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

此示例应用程序的源代码上传到github,链接如下:

source code

1 个答案:

答案 0 :(得分:0)

我实现了segue并添加动画并且它可以工作。