• 瀏覽: 741
[隱藏]
I hv the below codes in one of my UIView application.

I want to handle a single touch when the touchesBegan, and multiple touch in touchesMoved.

But I figure out that when I touch by 2 fingers, the below codes still run, which should not be true as I hve the "if ([touches count] == 1)" statement.

Any ching can help?

- (void) touchesBegan: (NSSet * ) touches withEvent: (UIEvent * ) event
{
   // handle only 1 finger
    if ([touches count] == 1)
    {
        NSLog(@"touchesBegan touches = 1");
        pt = [[touches anyObject] locationInView:self];
        [self setNeedsDisplay];
    }
}

[ 本帖最後由 b4321 於 2011-6-23 11:35 PM 編輯 ]



回覆 引用 TOP

[按此隱藏 Google 建議的相符內容]