I have a parent class (A) that is UIViewController. Than i create class B that is subclass of class A. What happens is that i can't catch touch events in class B with methods like touchesBegan. But if i implement this methods in class A ... they get called.
@interface A:UIViewController
.....
@interface B:A
To use a UIViewController, must do event like:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch;
CGPoint pos;
for( touch in touches )
{
//pos = [ touch locationInView:self ]; // Only work on UIView
pos = [touch locationInView:self.view ]; // Work on UIViewController
//NSLog(@"Touch: %f, %f",pos.x,pos.y);
// Send X, Y, tapcount
_faceOff->toucheBegan( pos.x, pos.y, [ [ touches anyObject ] tapCount ]);
}
}
Hope it help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With