如何计算在模拟器中点击?
答
- (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]);
它总是在模拟器 – 2009-06-27 05:24:53