本文介绍了NSXMLParser 泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下泄漏的代码.Instruments 说是 rssParser 对象正在泄漏.我刷新"了 XML 提要,它运行该块并泄漏....
I have the following code that leaks. Instruments says that it is the rssParser object that is leaking. I "refresh" the XML feed and it runs the block and it leaks....
文件.h
@interface TestAppDelegate : NSObject <UIApplicationDelegate> {
NSXMLParser *rssParser;
}
文件.m
NSData *data = [ NSURLConnection sendSynchronousRequest:request returningResponse: nil error: nil ];
rssParser = [[NSXMLParser alloc] initWithData:data];
[rssParser setDelegate:self];
[rssParser setShouldProcessNamespaces:NO];
[rssParser setShouldReportNamespacePrefixes:NO];
[rssParser setShouldResolveExternalEntities:NO];
[rssParser parse];
[rssParser release];
泄漏的图像....
替代文字 http://www.shipfinder.co.uk/images/memoryleak.png
推荐答案
Apple 已经回复我,这是一个错误 #6469143
Apple have got back to me and this is a bug #6469143
看起来他们计划修复 4.0
Looks like they plan to fix for 4.0
这篇关于NSXMLParser 泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!