我有三个手势:2 指点击、3 指点击和 4 指点击。我需要相应地获取坐标。
我尝试了以下方法来协调 2 个手指点击,但应用程序不断崩溃:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSArray *twoTouch = [touches allObjects];
UITouch *tOne = [twoTouch objectAtIndex:0];
UITouch *tTwo = [twoTouch objectAtIndex:1];
CGPoint firstTouch = [tOne locationInView:[tOne view]];
CGPoint secondTouch = [tTwo locationInView:[tTwo view]];
NSLog(@"point one: %@", firstTouch);
NSLog(@"point two: %@", secondTouch);
[twoTouch release];
}