MapKit 未删除所有注释
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]);
}
Now ,奇怪的是,我有时可以进入 mapView.annotations 计数大于 0 的情况。因此,我有额外的“保护”,并尝试手动删除项目比 NSLogged 注销。
然而最终的计数仍然是1!
最奇怪的是!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已向 Apple 记录了一个错误...
他们承认这是 4.2 的问题
Have logged a bug with Apple....
They acknowledge this is an issue with 4.2