Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MapKit not removing all annotations

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!

like image 906
Lee Armstrong Avatar asked Feb 25 '26 00:02

Lee Armstrong


1 Answers

Have logged a bug with Apple....

They acknowledge this is an issue with 4.2

like image 140
Lee Armstrong Avatar answered Feb 26 '26 19:02

Lee Armstrong