---
title: "版本升级之'initWithFrame:reuseIdentifier:' is deprecated"
author: "CoderDream"
date: "2011-10-25T19:55:23Z"
tags: []
categories: ["移动开发"]
slug: "initwithframe-reuseidentifier-is-deprecated"
draft: false
lastmod: "2011-10-25T19:57:45Z"
id: 1214087
url: "https://coderdream.iteye.com/blog/1214087"
---

在iOS3.0之后的版本不再使用这样的语法，解决方法如下：  
将：

```
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
```

  修改为：

```
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
```

 

参考：  
[http://forums.macrumors.com/archive/index.php/t-1239790.html](http://forums.macrumors.com/archive/index.php/t-1239790.html)