我在下面的代码中得到了泄漏。泄漏百分比@行尾。谁能告诉我问题出在哪里?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
coustomMessage *cell = (coustomMessage *)[tableView dequeueReusableCellWithIdentifier:@"coustomMessage"];
if (cell == nil) {
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"coustomMessage" owner:self options:nil]; (93.1%)
cell = [topLevelObjects objectAtIndex:0];
}
cell.nameLable.text = [self.nameArray objectAtIndex:indexPath.row]; (3.4%)
cell.messageStatusLable.text = [[self.endPointCountArray objectAtIndex:indexPath.row] stringValue]; (3.4%)
return cell;}发布于 2012-01-17 23:13:09
是否确实在XIB文件中设置了与代码中使用的名称相同的"identifier“属性(使用: dequeueReusableCellWithIdentifier:@"coustomMessage")?
发布于 2012-06-14 05:38:48
太棒了!我遇到了完全相同的问题,我在XIB中的标识符拼写错误,因此由于我们正在重新创建的单元没有被重用,所以有很多泄漏。谢谢!
https://stackoverflow.com/questions/8896912
复制相似问题