MapKit seems to have a weird problem !!!
I have a 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 weird bit is that from time to time I can get a counter greater than 0 inside mapView.annotations. Therefore, therefore, I have additional โprotectionโ and try manually deleting the item, rather than getting NSLogged.
However, the final score is 1 more after that!
The strangest thing!
source
share