MapKit 未删除所有注释

发布于 2024-10-03 03:40:00 字数 691 浏览 0 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

生生漫 2024-10-10 03:40:00

已向 Apple 记录了一个错误...

他们承认这是 4.2 的问题

Have logged a bug with Apple....

They acknowledge this is an issue with 4.2

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文