Got memory leak while parsing large xml files from url using TBXML with ARC on

Tink

New Member
I am using TBXML to parse XML files from an url and I have ARC on. But I got memory leak for the following code:\[code\]- (void)readXmlFromUrl:(NSString*)url{ NSURL *aUrl = [NSURL URLWithString:url]; NSData *data = http://stackoverflow.com/questions/12467363/[[NSData alloc] initWithContentsOfURL:aUrl]; TBXML *tbxml = [[TBXML alloc] initWithXMLData:data];// data = nil;// NSLog(@"Reading from %@", url); // If TBXML found a root node, process element and iterate all children if (tbxml.rootXMLElement) { NSLog(@"Root Found"); [self traverseElement:tbxml.rootXMLElement]; }// data = http://stackoverflow.com/questions/12467363/nil;// aUrl = nil;// tbxml = nil;// NSLog(@"Retain count for TBXML %d", tbxml.retainCount);}\[/code\]I attached an image of memory leak. Thanks in advance
pvzE4.png
 
Back
Top