MapKit 似乎有一个奇怪的问题!!!
我有一些添加一些注释的代码,然后我调用
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]);
}
现在奇怪的是,有时我可以进入 mapView.annotations 计数大于 0。因此,我有额外的“保护”并尝试手动删除该项目而不是 NSLogged。
然而最终的计数仍然是 1!
最奇怪!