本文介绍了-(void)swipeWithEvent:(NSEvent *)event在Lion上不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个简单的可可程序,应使用滑动手势。
我已经在我的 NSView 子类中实现了方法 swipeWithEvent:,但是当我尝试该程序时从未被调用。 rotateWithEvent:方法代替。
我在Mac OS 10.7 Lion上使用的Xcode 4.1。

I'm writing a simple cocoa program that should use the swipe gesture.I've implemented in my NSView subclass the method swipeWithEvent: but when i try the program the method is never called. rotateWithEvent: method works instead.I'm using a Xcode 4.1 on Mac OS 10.7 Lion.

rotateWithEvent之间是否有区别: swipeWithEvent:?为什么在视图下执行旋转手势时调用第一个,而在执行相同手势的情况下为什么不调用第二个处于相同状态的手势呢?

Is there a difference between rotateWithEvent: and swipeWithEvent: ?? Why the first is called when I'm under the view and do a rotate gesture and the second in the same condition is never called if i do the swipe gesture?

更新:
我还构建了一个简单的项目,仅用于检查 swipeWithEvent: rotateWithEvent:方法,但是其行为一样。

Update :I built also a simple project only to check the swipeWithEvent: and rotateWithEvent: methods but the behavior is the same.

推荐答案

看看我写的这个示例代码

Take a look at this sample code I wrote https://github.com/oscardelben/CocoaNavigationGestures

这篇关于-(void)swipeWithEvent:(NSEvent *)event在Lion上不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 12:03