How to intercept touches events on a MKMapView or UIWebView objects?

Posted by Martin on Stack Overflow See other posts from Stack Overflow or by Martin
Published on 2009-06-26T15:51:14Z Indexed on 2010/03/08 8:36 UTC
Read the original article Hit count: 590

Hello,

I'm not sure what i'm doing wrong but I try to catch touches on a MKMapView object. I subclassed it by creating the following class :

#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>

@interface MapViewWithTouches : MKMapView {

}

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *) event;   

@end

And the implementation :

#import "MapViewWithTouches.h"
@implementation MapViewWithTouches

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *) event {

    NSLog(@"hello");
    //[super touchesBegan:touches	withEvent:event];

}
@end

But it looks like when I use this class, I see nothing on the Console :

MapViewWithTouches *mapView = [[MapViewWithTouches alloc] initWithFrame:self.view.frame];
[self.view insertSubview:mapView atIndex:0];

Any idea what I'm doing wrong?

Heelp! :)

Thanks a lot!

Martin

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk