Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Kingbombs

macrumors member
Original poster
Jun 24, 2009
98
0
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:
Code:
mapView=[[MKMapView alloc] initWithFrame:self.view.frame];
	//mapView.showsUserLocation=TRUE;
	[mapView setUserInteractionEnabled:YES];
	mapView.mapType=MKMapTypeHybrid;
	mapView.delegate=self;
	[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
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.