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:53 AM   #4 (permalink)
Johanovski
Divine avenger
 
Johanovski's Avatar
 
Join Date: Nov 2009
Location: Vic, Catalunya (Spain)
Posts: 320
Johanovski is on a distinguished road
Default

Solved!

You were on the right way, Mr. Jack!

What I've done is to simply create a new NSSet from the event (to ensure that initial data won't be modified during the method) and then everything worked! Here's the new code:

Code:
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
	NSSet *touchSet = [event allTouches];  // <--- This is the happy line!
	
	if ([touchSet count] > 0) {
		// Hi ha 1 dit a la pantalla
		
		UITouch *t1 = [[touchSet allObjects] objectAtIndex:0];
		CGPoint touchPos1 = [t1 locationInView:t1.view];
		CGPoint touchPosAnt1 = [t1 previousLocationInView:t1.view];
		
		if ([touchSet count] > 1) {
			// Hi ha 2 dits a la pantalla
	
			for(UITouch *t in [touchSet allObjects])
			{
				NSLog(@"Luke, I'm your father!");
			}
			
			UITouch *t2 = [[touchSet allObjects] objectAtIndex:1];
			CGPoint touchPos2 = [t2 locationInView:t2.view];
		}
	}
}
Thanks for your time Mr. Jack!
Johanovski is offline   Reply With Quote
 

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

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