Ok, so you usually have an X object that you want to annotate inside MKMapView. You do this:
DDAnnotation *annotation = [[DDAnnotation alloc] initWithCoordinate: poi.geoLocation.coordinate title: @"My Annotation"]; [_mapView addAnnotation: annotation];
Then you create the annotation inside
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation;
And when some callouts come in, you handle the event internally:
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control;
What is the cleanest solution for moving X to the latest tap event?
cocoa-touch mkmapview mkannotation
Stefano verna
source share