MapKit not removing all annotations
-
26-09-2019 - |
Question
MapKit seems to have a strange issue!!!
I have some code that adds some annotations and then I call
NSArray *existingpoints = mapView.annotations;
[mapView removeAnnotations:existingpoints];
if ([mapView.annotations count] > 0) {
for(Plane *annotation in mapView.annotations){
NSLog(@"Name: %@",annotation.reg);
[mapView removeAnnotation:annotation];
}
NSLog(@"\nMapCount:%i after attempting manual remove",[mapView.annotations count]);
}
Now the strange bit is that from time to time I can get inside the mapView.annotations count being greater than 0. So therefore I have extra "protection" and try and manually remove the item than gets NSLogged out.
However the the final count is still 1 after all that!
Most strange!
Solution
Have logged a bug with Apple....
They acknowledge this is an issue with 4.2
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow