MKAnnotation is not displayed * until * the user drags the map

I am creating an application in which annotations mark points of interest that a user controls. The map tracks the user's location and scrolls forward, but the annotations that should be displayed on the map are not displayed until the user drags the map with their finger.

Adding and removing annotations works great, so I'm not sure which code to show.

Has anyone seen this behavior?

Edit:

This affects only some annotations — some appear, others not. There is no visible picture.

As I said, I changed the code to add and remove annotations only on the main thread:

dispatch_async(dispatch_get_main_queue(), ^{
    [self.mapView removeAnnotations:annotationsToRemove];
    [self.mapView addAnnotations:annotationsToAdd];
});

But the problem persists. Heck...

+4
2

.

[_mapView addAnnotation:theAnnotation];
[_mapView deselectAnnotation:theAnnotation animated:NO];
[_mapView selectAnnotation:theAnnotation animated:NO];

, , , ( ). , !

+1

, . , , , - mapView: didUpdateUserLocation , , (. , MKAnnotation MKCoordinateRegion, rect).

+1

Source: https://habr.com/ru/post/1545753/


All Articles