滑动手势问题

时间:2014-07-05 13:32:06

标签: ios cocoa-touch swift

我在xCode 6上使用了一次轻扫手势(使用Swift)。它运作良好。

@IBAction func ArrasteiDireita(sender: UISwipeGestureRecognizer) {
    println("Arrastei Direita")
}

我删除了手势(在main.storyboard中)并尝试使用Pan Gesture,但我不知道为什么仍需要滑动手势。

如果注释了关联的方法(上面的ArrasteiDireita),我收到以下错误:

2014-07-05 10:48:51.400 Verdadeiro ou Falso[51178:2926619] -    [_TtC19Verdadeiro_ou_Falso4Jogo ArrasteiDireita:]: unrecognized selector sent to instance     0xb23bfa0
2014-07-05 10:48:51.402 Verdadeiro ou Falso[51178:2926619] *** Terminating app due to    uncaught exception 'NSInvalidArgumentException', reason: '-[_TtC19Verdadeiro_ou_Falso4Jogo   ArrasteiDireita:]: unrecognized selector sent to instance 0xb23bfa0'
*** First throw call stack:
(
0   CoreFoundation                      0x00842646 __exceptionPreprocess + 182
1   libobjc.A.dylib                     0x0216d8e3 objc_exception_throw + 44
2   CoreFoundation                      0x00849575 -[NSObject(NSObject) doesNotRecognizeSelector:] + 277
3   CoreFoundation                      0x00794407 ___forwarding___ + 1047
4   CoreFoundation                      0x00793fce _CF_forwarding_prep_0 + 14
5   UIKit                               0x01466e63 _UIGestureRecognizerSendActions + 327
6   UIKit                               0x0146509c -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 1657
7   UIKit                               0x0146772d -[UIGestureRecognizer _delayedUpdateGesture] + 60
8   UIKit                               0x0146b1cc ___UIGestureRecognizerUpdate_block_invoke689 + 347
9   UIKit                               0x0146af6d _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 317
10  UIKit                               0x0145e0a8 _UIGestureRecognizerUpdate + 3786
11  UIKit                               0x0108ff3b -[UIWindow _sendGesturesForEvent:] + 1356
12  UIKit                               0x01090d9f -[UIWindow sendEvent:] + 769
13  UIKit                               0x01056c29 -[UIApplication sendEvent:] + 242
14  UIKit                               0x010665e2 _UIApplicationHandleEventFromQueueEvent + 20518
15  UIKit                               0x0103bcc5 _UIApplicationHandleEventQueue + 2154
16  CoreFoundation                      0x00766faf __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
17  CoreFoundation                      0x0075c34d __CFRunLoopDoSources0 + 253
18  CoreFoundation                      0x0075b8a8 __CFRunLoopRun + 952
19  CoreFoundation                      0x0075b22b CFRunLoopRunSpecific + 443
20  CoreFoundation                      0x0075b05b CFRunLoopRunInMode + 123
21  GraphicsServices                    0x0417e3ca GSEventRunModal + 192
22  GraphicsServices                    0x0417e207 GSEventRun + 104
23  UIKit                               0x0103f6e5 UIApplicationMain + 1526
24  Verdadeiro ou Falso                 0x0000d591 top_level_code + 97
25  Verdadeiro ou Falso                 0x0000d5cb main + 43
26  libdyld.dylib                       0x026aeac9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

由于滑动手势发生在Pan Gesture之前,我无法达到Pan Gesture方法:

@IBAction func Arrastei(sender: UIPanGestureRecognizer) {
    println("Arrastado")
}

我需要删除Swipe Gesture的引用吗?

0 个答案:

没有答案