如何拦截MKMapView或UIWebView对象上的触摸事件?
我不确定自己在做什么错,但是我试图抓住MKMapView物体。我通过创建以下类将其子类化: #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface MapViewWithTouches : MKMapView { } - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *) event; @end 并执行: #import "MapViewWithTouches.h" @implementation MapViewWithTouches - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *) event { NSLog(@"hello"); //[super touchesBegan:touches withEvent:event]; } @end 但是当我使用此类时,在控制台上什么也看不到: MapViewWithTouches *mapView = [[MapViewWithTouches alloc] initWithFrame:self.view.frame]; [self.view insertSubview:mapView atIndex:0]; 知道我在做什么错吗?