MKMap annotation selection
I want 开发者_如何学Pythonto check when he user presses the annotation (the bubble on top of the pin). I tried the following :
-(void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view{}
but it fires up when i press the pin. How can i check when the user actually presses on the annotation bubble?
You can first put a right accessory button and set an separate action for it as such:
UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[rightButton addTarget:self
action:@selector(showDetails:)
forControlEvents:UIControlEventTouchUpInside];
customPinView.rightCalloutAccessoryView = rightButton;
you can implement the showDetails
method with the function that you like
精彩评论