我有以下代碼:多點觸摸沒有在iPhone應用程序工作,我要建
- (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];
}
當我運行它,它永遠不會檢測到多個觸摸。有一些設置可能會阻止我的應用程序進行多次觸摸嗎?或者我在這裏錯過了什麼?
謝謝你,我在代碼中創建了視圖,並試圖弄清楚它。我做到了,現在它工作得很好! – 2009-02-27 21:25:47