Great Tutorial! Really helpful.
I have one question though, How do I check WHERE it is touched? I have this code in my "myImageView"
Code:
-(void) touchesBegan: (NSSet *) touches withEvent: (UIEvent *) event
{
UITouch *touch = [touches anyObject];
CGPoint touchPoint = [touch locationInView:self];
NSLog(@"Touch detected at: X = %d, Y = %d", touchPoint.x, touchPoint.y);
}
But that returns this in the log:
Code:
2011-03-11 07:05:56.969 Us![3428:207] Touch detected at: X = 0, Y = 1085492480
2011-03-11 07:05:57.322 Us![3428:207] Touch detected at: X = 0, Y = 1085492480
2011-03-11 07:05:57.529 Us![3428:207] Touch detected at: X = 0, Y = 1085492480
And that is DEFINITELY not where I touched it, and I moved quite a lot to try and get something else. Thanks!
EDIT: Nevermind... I was logging it incorrectly. :P