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