【发布时间】:2010-10-10 10:41:02
【问题描述】:
我有以下代码:
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
NSUInteger touchCount = 0;
// Enumerates through all touch objects
for (UITouch *touchb in touches){
touchCount++;
}
// When multiple touches, report the number of touches.
if (touchCount > 1) {
lblStatustouch.text = [NSString stringWithFormat:@"Tracking %d touches", touchCount];
} else {
lblStatustouch.text = [NSString stringWithFormat:@"Tracking 1 touch", touchCount];
}
当我运行它时,它从不检测超过一次触摸。是否有一些设置可能会阻止我的应用程序进行多次触摸?还是我在这里遗漏了什么?
【问题讨论】:
标签: iphone objective-c ipod-touch