如何计算在模拟器中点击?

问题描述:

我如何计算模拟器中的双击?如何计算在模拟器中点击?

- (void) touchesBegan:(NSSet *) touches withEvent:(UIEvent *) event 
{ 
    UITouch *touch = [touches anyObject]; 
    if (touch.tapCount == 2) 
    { 
     // do your stuff here 
    } 
} 

实现的在UIResponder限定的触摸功能之一(的touchesBegan,touchedEnded等...)。当你的触摸阵列,可以使用如下代码获得UITouch的敲击次数:

UITouch * t = [touches anyObject]; 
NSLog(@"%d", [t tapCount]); 
+0

它总是在模拟器 – 2009-06-27 05:24:53