これはあなたの質問に対処しないかもしれません。ただし、いくつかの回避策があります。
私は同様の問題に遭遇しました。データを分類し、それに応じて条件とともに表記を示しました。このコードが私がそれをどのようにしたかについてあなたにいくつかの考えを与えることを願っています。
-(MKAnnotationView*)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation
{
MKPinAnnotationView *view = nil;
if (annotation != mapView.userLocation) {
view = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"myAnnotationIdentifier"];
if (!view) {
view = [[MKPinAnnotationView alloc]initWithAnnotation:annotation reuseIdentifier:@"myAnnotationIdentifier"];
CustomClassAnnotation *desclosureButton = [[CustomClassAnnotation alloc] initWithFrame:CGRectMake(0, 0, 29, 31)];
[desclosureButton addTarget:self action:@selector(mapAction:) forControlEvents:(UIControlEventTouchUpInside)];
view.rightCalloutAccessoryView = desclosureButton;
view.canShowCallout = YES;
}
((CustomClassAnnotation *)view.rightCalloutAccessoryView).annotation = annotation;
if (((MapViewAnnotation *)annotation).type == 1) {
view.image = [UIImage imageNamed:@"image_type1.png"];
}
else if (((MapViewAnnotation *)annotation).type == 2) {
view.image = [UIImage imageNamed:@"image_type2.png"];
}
else if (((MapViewAnnotation *)annotation).type == 3) {
view.image = [UIImage imageNamed:@"image_type3.png"];
}
}
return view;
}
幸運を祈ります...