小编a31*_*16b的帖子

initWithFrame:reuseIdentifier:已弃用

在我的项目中,我有一个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)

deprecated reuseidentifier ios xcode4

30
推荐指数
2
解决办法
3万
查看次数

使用Xcode anaylser的死代码

我想分析我的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)

xcode dead-code ios

0
推荐指数
1
解决办法
1657
查看次数

标签 统计

ios ×2

dead-code ×1

deprecated ×1

reuseidentifier ×1

xcode ×1

xcode4 ×1