我一直在使用仪器测试设备(iOS 5)上的应用程序,并发现了一些内存泄漏。iOS 5 cellForRowAtIndexPath内存泄漏
这是我被从仪器重定向到代码的一部分(见确切线箭头):
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CeldaUltimasFotosViewCell *cell =
(CeldaUltimasFotosViewCell *) [self.tableView
dequeueReusableCellWithIdentifier:@"CeldaUltimasFotosViewCell"];
if (cell == nil) {
- - - - > NSArray *topLevelObjects =
[[NSBundle mainBundle]
loadNibNamed:@"CeldaUltimasFotosViewCell"
owner:nil options:nil];
cell = [topLevelObjects objectAtIndex:0];
}
// Configure the cell...
[[cell titulo] setFont:fuente_titulo];
...
return cell;
}
正如你所看到的,我有从加载自定义单元格NIB文件。该单元有三个文件(,customCell.h
,customCell.xib
)。问题是,我不知道是否必须在单元控制器(现在是空的,没有方法)中释放某些东西,因为这是带有ARC的iOS 5。
它似乎在工作。谢谢你,托尼! – 2012-02-13 12:12:32