ios5中的autorelease方案有哪些选择?此前为表视图下面的方法将工作:ios5上的autorelease替代方案
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSUInteger row = [indexPath row];
static NSString *TableIdentifier = @"TableIndentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:TableIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:TableIdentifier]autorelease];
}
cell.textLabel.text = [arrAccounts objectAtIndex:row];
return cell;
}
如何过,现在我得到一个消息“ARC者禁用”和“自动释放不可用” ...什么是周围的工作吗?
纠正我,如果我错了,但我认为ARC是一个编译器功能,而不是iOS 5功能。所以你应该可以在以前的iOS版本上运行ARC编译的应用程序。如果您不想使用ARC,则不需要使用ARC,可以关闭它并继续使用保留版本。 – Stefan
@Stefan并不完全如此。操作系统也必须支持ARC。也就是说,iOS4之前没有任何ARC支持。 – Till