Estoy anotando mi mapa y estableciendo una imagen muy bien, pero cuando toco la anotación en MapView, la imagen va de mi imagen personalizada al pin rojo. ¿Por qué es esto?¿Por qué una imagen personalizada de anotación MKMapView desaparece al tocar?
- (MKAnnotationView *)mapView:(MKMapView *)newMapView viewForAnnotation:(id)newAnnotation {
MKPinAnnotationView *annotation = [[MKPinAnnotationView alloc] initWithAnnotation:newAnnotation reuseIdentifier:@"currentloc"];
if (annotation == nil) {
annotation = [[MKAnnotationView alloc] initWithAnnotation:newAnnotation reuseIdentifier:@"currentloc"];
}
annotation.image = [UIImage imageNamed:@"anno.png"];
annotation.canShowCallout = YES;
annotation.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bus_stop_30x30.png"]];
annotation.leftCalloutAccessoryView = imgView;
return annotation;
}
Mi código es idéntico a un código de muestra que no produce este problema.
gracias por este solution..saved mi tiempo .. –