iPhone应用程序中的MKMapView内存泄漏 [英] MKMapView Memory Leak in iPhone Application

查看:76
本文介绍了iPhone应用程序中的MKMapView内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用使用MKMapView并显示用户位置的iPhone应用程序.当将MKMapView的showUserLocation属性设置为TRUE时,泄漏的对象是大小为128字节的 NSCFArray ,GeneralBlock-16,GenralBlock-8,我遇到了内存泄漏.如果将其设置为否,那么我不会泄漏.任何人都可以提出这可能是什么原因的建议.这是MKMapView类中的错误还是我错误地使用了MKMapView.有人可以告诉我使用MKMapView并同时显示userLocatio n的最佳方法是什么.

I am working on an iPhone application which uses MKMapView and shows userlocation. I am getting memory leaks where leaked object is NSCFArray of size 128 Bytes, GeneralBlock-16, GenralBlock-8 when is set MKMapView's showUserLocation property as TRUE. If is set it as NO then i dont get this leak. Can anyone suggest that what can be the possible reason for this. Is this a bug in MKMapView class or is am I using the MKMapView incorrectly. Can someone tell me what is the best way to use MKMapView and show userLocation also.

感谢&问候, 普里扬卡·阿加瓦尔(Priyanka Aggarwal)

Thanks & Regards, Priyanka Aggarwal

推荐答案

我遇到了完全相同的问题.在我看来,这似乎是MKMapView中的错误.我想到了三种解决方法:

I have the exact same issue. It looks like a bug in MKMapView to me. Three workarounds come to mind:

  1. 为当前位置创建自己的注释.
  2. 请勿破坏并重新创建视图,因此您只会泄漏一次.
  3. 将其关闭.

对我来说幸运的是,我可以将其关闭,而不会损失任何功能.

Fortunately for me I can turn it off without any significant loss of feature.

这篇关于iPhone应用程序中的MKMapView内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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