我有以下泄漏的代码。Instruments 说泄漏的是 rssParser 对象。我“刷新”了 XML 提要,它运行了这个块并且它泄漏了......
文件.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];
泄漏的图像......