I am trying to get the coordinates from a touch but I can't figure out how.
I am in a view controller and I try to use the method -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
but I think it doesn't work with view controllers.
Am I right?
I just want to put a Button on the position I touched.
Thanks in advance!
It belongs in a View rather than ViewController, and would look something like this:
-(void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)evt {
UITouch *touch=[touches anyObject];
CGPoint pt=[touch locationInView:self];
// ...make your button at 'pt'...
}