Hi Mr. Jack!
I've tried this but the problem is that by using "[touches allObjects]" the counter is always one, so seems that there's only one finger on the screen, but by using "[event allTouches]" I can't compile because I can't access to the touch via the "[[event allTouches] objectAtIndex:n]" method...
I've tried replacing all my code by the "[touches allObjects]" and the result is:
Code:
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
if ([[touches allObjects] count] > 0) {
// Hi ha 1 dit a la pantalla
UITouch *t1 = [[touches allObjects] objectAtIndex:0];
CGPoint touchPos1 = [t1 locationInView:t1.view];
CGPoint touchPosAnt1 = [t1 previousLocationInView:t1.view];
NSLog(@"1");
if ([[touches allObjects] count] > 1) {
// Hi ha 2 dits a la pantalla
NSLog(@"2");
for(UITouch *t in [touches allObjects])
{
NSLog(@"Luke, I'm your father!");
}
UITouch *t2 = [[touches allObjects] objectAtIndex:1];
CGPoint touchPos2 = [t2 locationInView:t2.view];
}
}
}
And the console shows:
Code:
2010-02-23 10:36:49.175 provaObjectes3D[1996:207] 1
2010-02-23 10:36:49.331 provaObjectes3D[1996:207] 1
2010-02-23 10:36:49.354 provaObjectes3D[1996:207] 1
(repeat ad infinitum...)
So seems that counter is never > 1...
Any clue about this?