Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 02-23-2010, 03:41 AM   #3 (permalink)
Johanovski
Divine avenger
 
Johanovski's Avatar
 
Join Date: Nov 2009
Location: Vic, Catalunya (Spain)
Posts: 320
Johanovski is on a distinguished road
Default

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?
Johanovski is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,524
Threads: 94,042
Posts: 402,617
Top Poster: BrianSlick (7,978)
Welcome to our newest member, tomokogk47
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:53 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.