更改mkmapview(删除注释) [英] altering the mkmapview (removing annotations)

查看:76
本文介绍了更改mkmapview(删除注释)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序发生了奇怪的崩溃 首先,我将使您对应用程序一目了然,有一个包含许多注释的地图,并且我自定义了这些注释的标注,使其成为一个包含按钮和许多信息的视图,它包含一个具有动作的按钮转到应用程序中的另一个选项卡,它称为DisclosureButton

I have a weird crash occurred in my application First of all, I would get you a glance about the application, there is a map that contains many annotations and also I customized the callout of these annotation to be a view that contains buttons and many information, it contains a button that have an action to go to another tab in the application, it is called DisclosureButton

我向项目添加了一个断点异常,所以我知道了应用程序崩溃的位置,您可以在上面的第173行看到它 正如您在上面的控制台中看到的那样,view.annotation为null,因此在某些时候已删除了注释.在检查了线程1(主线程,您可以在下面看到)执行的动作之后,我看到,从地图中删除注释时,将执行显示按钮动作.为什么主线程停止执行updateMap方法并启动显示按钮的动作?这就是控制台首先显示的删除注释之前",然后显示披露按钮动作中的日志,而没有记录创建注释之前",这很奇怪,我不确定此时发生了什么?

I added a breakpoint exception to the project so I got where the app is crashed, you can see it above at line 173 As you can see in the above console, the view.annotation is null so the annotations was removed at some point. After checking the action performed by thread 1(the main thread, you can see it below) I see that while removing the annotations from the map, the disclosure button action is performed. why the main thread stops to the perform the updateMap method and start the action for the disclosure button? that’s what the console shows first "before remove the annotation" then the logs within the action of the disclosureButton without logging "before creation the annotation", it is something very weird, I’m not sure what is happening at this point ???

我不确定发生了什么,任何建议/意见/帮助将不胜感激

I'm not sure what is happening, any suggestion/comments/assistance would be appreciated

预先感谢

推荐答案

iOS 6喜欢爆炸地图上的注释,因为谁知道原因.我的解决方案是仅将注释保留在拥有的类中,然后处理内存.它目前可以使用,但是它不能让本地的mapKit处理它...不确定是否应该观看新的WWDC视频或是否向MKMap编程文档中添加了页面,但是现在可以使用了.

iOS 6 likes to blast the annotations in the map, for who knows why. My solution is to just retain the annotation (s) in the owning class, and handle the memory. It's working for now, but it doesn't let the native mapKit handle it... unsure if there's a new WWDC video I should watch or a page added to MKMap programming documents, but for now this works.

这篇关于更改mkmapview(删除注释)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆