MKPinAnnotationViewでなく、MKAnnotationViewを使います。
Before
-(MKAnnotationView*)mapView:(MKMapView*)mapView
viewForAnnotation:(id)annotation{
CustomAnnotation* ca = (CustomAnnotation*)annotation;
static NSString *PinIdentifier = @"Pin";
MKPinAnnotationView* av = (MKPinAnnotationView *)[mapView
dequeueReusableAnnotationViewWithIdentifier:PinIdentifier];
if (!av) {
av = [[MKPinAnnotationView alloc] initWithAnnotation:annotation
reuseIdentifier:PinIdentifier];
av.canShowCallout = YES;
av.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
}
av.image = [UIImage imageNamed:@"image.png"];
av.annotation = annotation;
return av;
}
After
-(MKAnnotationView*)mapView:(MKMapView*)mapView
viewForAnnotation:(id)annotation{
CustomAnnotation* ca = (CustomAnnotation*)annotation;
static NSString *PinIdentifier = @"Pin";
MKAnnotationView * av = (MKAnnotationView *)[mapView
dequeueReusableAnnotationViewWithIdentifier:PinIdentifier];
if (!av) {
av = [[MKAnnotationView alloc] initWithAnnotation:annotation
reuseIdentifier:PinIdentifier];
av.canShowCallout = YES;
av.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
}
av.image = [UIImage imageNamed:@"image.png"];
av.annotation = annotation;
return av;
}