小编Glo*_*awk的帖子

两个UILongPressGestureRecognizer,一个可以开火,另一个不可以

伙计们,

我添加了两个UILongPressGestureRecognizer.我想要的是当按下两个按钮0.3秒时,启动"shortPressHandler".如果用户再按下这两个按钮1.2秒,则启动"longPressHandler".现在我只得到shortPressHandler启动并且longPressHandler从未被解雇.我认为这可能是因为shortPressGesture首先被识别而longPressGesture永远不会有机会.任何人都可以告诉我如何实现我想要的东西吗?提前致谢.

UILongPressGestureRecognizer *longPressGesture =[[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressHandler:)] autorelease];
longPressGesture.numberOfTouchesRequired = 2;
longPressGesture.minimumPressDuration = 1.5;
longPressGesture.allowableMovement = 10;
longPressGesture.cancelsTouchesInView = NO;
longPressGesture.enabled = true;
[self.view addGestureRecognizer:longPressGesture];

UILongPressGestureRecognizer *shortPressGesture =[[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(shortPressHandler:)] autorelease];
shortPressGesture.numberOfTouchesRequired = 2;
shortPressGesture.minimumPressDuration = 0.3;
shortPressGesture.allowableMovement = 10;
shortPressGesture.cancelsTouchesInView = NO;
shortPressGesture.enabled = true;
[self.view addGestureRecognizer:shortPressGesture];
Run Code Online (Sandbox Code Playgroud)

iphone cocoa ipad ios

6
推荐指数
1
解决办法
1452
查看次数

如何连接到虚拟机上运行的数据库?

我在这里有一个问题。我心里似乎有些复杂。希望我能把自己说清楚。:)

  1. 我有一个Win7系统(系统A),上面运行着一个Win7 VM(系统B)。
  2. 系统B通过VPN连接到内网,将一些实时数据记录到本地sql server数据库中。管理员禁用了 Internet 连接,因此系统 B 与外部隔离。
  3. 现在系统A想要连接到这个数据库并读取这些实时数据。

是否可以?

database vmware virtual-machine

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

cocoa ×1

database ×1

ios ×1

ipad ×1

iphone ×1

virtual-machine ×1

vmware ×1