在我的项目中,我有一个Deprecations警告,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;
}
Run Code Online (Sandbox Code Playgroud)
警告就在那条线上:
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
Run Code Online (Sandbox Code Playgroud) 我想分析我的projet,xcode分析器在我的root控制器中找到一些死代码Xcode告诉我:
Dead code
The left operand to '+' is always 0
-> Variable 'i' initialized to 0
-> The left operand to '+' is always 0
Run Code Online (Sandbox Code Playgroud)
有人可以解释我这个如何清理该代码,谢谢....
这是我的rootcontroller.m
#import "RootViewController22.h"
#import "LabelCell.h"
#import "NibLoadedCell.h"
#import "GradientBackgroundTable.h"
#import "NibLoadedCell2.h"
#import "NibLoadedCell3.h"
@implementation RootViewController22
//
// title
//
// returns the navigation bar text for the front screen
//
/*- (NSString *)title
{
return NSLocalizedString(@"Les Robes du Bengal", @"");
}*/
//
// createRows
//
// Constructs all the rows on the front …Run Code Online (Sandbox Code Playgroud)