3

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!

Lee Armstrong
  • 11,420
  • 15
  • 74
  • 122
  • Not sure if this will cause this but do you have showsUserLocation turned on? –  Nov 20 '10 at 13:40
  • No, not in this example I don't. I did and that was one of my first ports of call! – Lee Armstrong Nov 20 '10 at 15:54
  • What happens when you examine the remaining annotation in the debugger? Look at the remaining object and its contents. – Nick Nov 20 '10 at 20:25
  • It is a valid object strangely enough and has all the properties. It even shows on the map and I can interact with it! – Lee Armstrong Nov 20 '10 at 21:12

1 Answers1

2

Have logged a bug with Apple....

They acknowledge this is an issue with 4.2

Lee Armstrong
  • 11,420
  • 15
  • 74
  • 122