У меня есть собственный класс просмотра аннотаций, который выглядит как
@interface MyAnnotationView : MKAnnotationView
@property (nonatomic, strong) UIImageView *imageView;
@end
, а затем я использую его в MKMapView:
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation
{
MKAnnotationView *annotationView = nil;
MyAnnotationView *view = (MyAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:MyAnnotationViewIdentifier];
if (view == nil) {
view = [[MyAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:MyAnnotationViewIdentifier];
}
view.imageView.image = myImage;
annotationView = view;
return annotationView;
}
Этот код работает, как и ожидалось, до iOS 11,но в iOS 12 я больше не вижу изображения.Что мне не хватает?Любые советы приветствуются.