I am exploring the way touch events are handled on iOS devices. I referred the book: iOS Open Application Development. Working on that, I am overriding the mouseDown, mouseUp methods and simply displaying the co-ordinates in an alert box. However, the overridden methods never get called. The following is the code for the newView Class that derives from UIView:
-(void) _mouseDown: (GSEventRef) event{
CGPoint point =GSEventGetLocationInWindow(event);
UIAlertView* alert;
NSString* alertString =[NSString stringWithFormat: @"%f %f", point.x, point.y];
alert = [[UIALertView alloc] initWithTitle:@"Success" message:alertString delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
}
-(BOOL) canHandleGestures{
return YES;
}
Is there any part that I missing ? Also, is there an alternative way of getting information on touch events and handling them ?