我有以下代码:
- (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];
}
当我运行它时,它永远不会检测到一次以上的触摸。是否有一些设置可能会阻止我的应用程序进行多次触摸?或者我在这里错过了什么?