在我的项目中,我收到了弃用警告, initWithFrame : reuseIdentifier : 已弃用
我不知道这是什么意思,谁能告诉我如何解决这个警告谢谢
这是短代码
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
// Set up the cell...
NSString *cellValue = [itemsList objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;
return cell;
}
并且警告在那一行:
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];