【发布时间】:2010-05-24 10:53:19
【问题描述】:
iPhone 的主视图控制器出现泄漏。
当我调用这个方法时,我将它们插入到filteredListCount 数组中,因为当我搜索时我需要显示来自filteredListCount 数组的列表,否则customerArray。
此功能运行良好,但在分配时我在以下方法中出现泄漏:filteredListCount = [[NSMutableArray alloc] initWithCapacity: [customerArray count]];
这是我的应用程序的第一个视图控制器,我正在显示列表,我也允许从列表中搜索。
- (void)parser:(CustomerListLibXmlParser *)parser addCustomerObject:(Customer *)customerObj1
{
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
[customerArray addObject:customerObj1];
filteredListCount = [[NSMutableArray alloc] initWithCapacity: [customerArray count]];
[filteredListCount addObjectsFromArray: customerArray];
[theTableView reloadData];
}
- (void)parser:(CustomerListLibXmlParser *)parser encounteredError:(NSError *)error
{
}
- (void)parserFinished:(CustomerListLibXmlParser *)parser
{
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
self.title=@"Customers";
}
【问题讨论】:
标签: iphone objective-c memory-leaks nsmutablearray