当我使用与SeismicXML示例相同的NSXMLParser时出现内存泄漏问题 [英] Got memory leak problem when i used NSXMLParser same as SeismicXML Example

查看:54
本文介绍了当我使用与SeismicXML示例相同的NSXMLParser时出现内存泄漏问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经完成了与SeismicXML示例相同的xml解析.但是现在它给了我内存泄漏的问题.

I have done xml parsing same as SeismicXML example. But now it gives me memory leak problem.

当我使用仪器测试SeismicXML时,它也会产生相同的内存泄漏.

When i tested SeismicXML with instruments, it also give same memory leak.

在SeismicXML中,有EarthQuake示例,它包含来自xml解析的所有字符串和数组. SO泄漏"工具将所有这些字符串和数组显示为泄漏的对象.

In SeismicXML, EarthQuake example is there, it contains all the string and array which come from xml parsing. SO 'Leak' instruments showing all this string and array as leaked objects.

我花了很多时间来解决这个问题.但是我还不能解决.如果有人解决了这个问题,请与我分享您的评论.

I spent lot time behind this issue. but i couldn't solve yet. If anybody has solve this issue then pls share your review with me.

谢谢, 哈雷什

推荐答案

在初始化NSXMLParser之前,请设置以下内容:

Before I initialize my NSXMLParser I set the following:

[[NSURLCache sharedURLCache] setMemoryCapacity:0];
[[NSURLCache sharedURLCache] setDiskCapacity:0];
NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:URL];

这不会泄漏.

这篇关于当我使用与SeismicXML示例相同的NSXMLParser时出现内存泄漏问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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