Hi all, I'm new to Objective-C so be patient
In my iPhone app I have a class TapDetectingImageView that inherits from UIImageView and I also have a CustomButton class that inherits from TapDetectingImageView. This is the class we get from Apple (
ScrollViewSuite: 1_TapToZoom/Classes/TapDetectingImageView.h)
Now, I have a consumer object that holds an instance (myButton) of CustomButton and with this command:
[myButton setDelegate:self];
I can call the method tapDetectingImageView when I touch myButton. But what I need is this chain of events:
1. TapDetectingImageView calls its tapDetectingImageView method
2. CustomButton calls its tapDetectingImageView method
3. consumer object calls its tapDetectingImageView method
but while events 1 and 3 are already happening I don't know how to hook the touch event in CustomButton. I tried to put this in CustomButton.m:
Code:
- (void)tapDetectingImageView:(iSimonButton *)view gotSingleTapAtPoint:(CGPoint)tapPoint {
NSLog(@"tap button!");
}
but it doesn't work. I guess I need to say somewhere that CustomButton delegate itself, but where?
thanks