0
得到了下面这条mem泄漏的警告......为什么这是一个mem泄漏?
有什么想法吗?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSUInteger row = [indexPath row];
UITableViewCell *cell = [self newOrReusableCell];
cell.textLabel.text = [_evaluationArray objectAtIndex:row];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
感谢
编辑:下面就警告: ...对象上线128分配,并存储到“细胞”是由他的名字的方法返回(“的tableView:的cellForRowAtIndexPath:”)不不包含“复制”或以“新”或“分配”开头。这违反了Cocoa的内存管理指南(对象泄露)给出的命名约定规则
你使用什么编译器?这是我见过的最好的编译器警告:O – 2011-03-08 21:14:18
可能是Clang/LLVM。 – Wevah 2011-03-08 23:13:18
@ Wevah我总是使用Clang,但我从来没有见过这样的警告。 – 2011-03-09 12:19:12