Xcode Problem - dragging images

Joined
Oct 7, 2010
Messages
2
Reaction score
0
Points
1
Hi, iv found this tutorial on dragging 2 things at the one time:

YouTube - iPhone SDK Tutorial - Dragging more than 1 image around on the screen

To do so it says to use the following code:

Code:
@implementation exampleViewController

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
	
	UITouch *touch = [[event allTouches] anyObject];
	
	if ([touch view] == image1) {
		CGPoint location = [touch locationInView:self.view];
		image1.center = location;
	}
	
	if ([touch view] == image2) {
		CGPoint location = [touch locationInView:self.view];
		image2.center = location;
	}
}

For some reason when i test my app on the device and in simulator, i get no errors but the images remain still.

Can anyone explain why ?

Thanks
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top