的setText已被弃用
问题描述:
嗨,我工作了Xcode和对象 - 和我得到这样的警告:的setText已被弃用
弃用:“的setText:”已被弃用
我想知道什么新方法是
这是我的代码:
[cell setText:[NSString stringWithFormat:@"I am cell %d", indexPath.row]];
答
的setText确实过时了。使用为textLabel的setText代替:
cell.textLabel.text = [NSString stringWithFormat:@"I am cell %d", indexPath.row];
+0
谢谢,我想到的是均是如此。 – Rollo
答
当你得到一个过时的警告,只是ALT +点击触发它的方法或属性,你会得到基本的信息看,从文件一酥料饼的视图中,包括财产或您应该使用的方法。
请使用搜索框提问之前: http://stackoverflow.com/questions/1089676/alternative-to-deprecated-uitableviewcell-settext/1089683#1089683 –