在我的代码中显示 2 处内存泄漏,请参阅并帮助我。
1.第一
UIButton *push = (UIButton *)sender;
NSString *string = [NSString stringWithFormat:@"%@",[push currentTitle]];
NSArray *chunks = [[NSArray alloc]initWithArray:[stringcomponentsSeparatedByString:@"-"]];
list = [[NSMutableArray alloc]initWithArray:chunks];
(NSMutableArray *list;)
[chunks release];
2.第二
这里首先是源代码
NSAutoreleasePool *pool = [NSAutoreleasePool new];
NSURL *url = [[NSURL alloc]initWithString:@"http://www/absdf.com/myXML.xml"];
self.parser = [[NSXMLParser alloc]initWithContentsOfURL:url];
[parser setDelegate:self];
[parser parse];
[parser release];
[url release];
[pool drain];
虽然我正在执行此代码并在行号上使用此仪器工具:2 显示内存泄漏和最重的回溯。所以请告诉原因。?