Im using the following code:
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
self.location = [touch locationInView:self.view];
NSLog(@"%@", NSStringFromCGPoint(location));
}
In order to try and find where the user might touch the screen, and i thought that [touches anyobject]
would allow it to detect where the user has touched the screen even if another object has been selected. However when I select a button it seems that it is not the case. Could anyone help me out?
Thanks!