【发布时间】:2012-10-03 22:44:26
【问题描述】:
我正在将一些代码从一个项目复制到另一个项目以填充表格视图, 我收到此错误
ABC Forbids explicit message sent of auto release
当我尝试创建 UITableViewCell 对象时。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
// this line produces the error
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
【问题讨论】:
-
哈哈。你是说 ARC 吗?
标签: iphone