MapKit and touch events problem

Discussion in 'iOS Programming' started by Kingbombs, Aug 30, 2009.

  1. Kingbombs macrumors member

    Jun 24, 2009
    So I'm using mapkit at the moment to display some google maps

    I want to allow user interaction (touchesBegan method etc)
    Problem is once i add the the mapView as a subview it doesn't recognize any touch events

    i have:
    mapView=[[MKMapView alloc] initWithFrame:self.view.frame];
    	[mapView setUserInteractionEnabled:YES];
    	[self.view insertSubview:mapView atIndex:0];

    I just tried setUserInteractionEnabled:YES
    But that doesn't make any difference
    I'm guessing I'm missing something pretty important to add touch events to the sub view?

    any help would be useful! thank you

    PS: i want to do this with the map still allowing its old touches (pinch to zoom and drag to move map) i just wan to tap the screen once and record that information
  2. KoolStar macrumors demi-god


    Oct 16, 2006
    When a map view is used the touch events are handled by the mapviewcontroller, they are not handled by the uiview that the mapview is located on.

Share This Page