【发布时间】:2017-02-13 05:44:21
【问题描述】:
【问题讨论】:
-
cell count 是行索引加一,因为索引是从零开始的。 (
indexPath.row + 1)
标签: objective-c uitableview uilabel
【问题讨论】:
indexPath.row + 1)
标签: objective-c uitableview uilabel
在您的cellForRowAtIndexPath 中,您只需设置单元格的UILabel,如下所示:
cell.countLabel.text = [NSString stringWithFormat:@"%ld)", (long)indexPath.row +1];
【讨论】:
Xcode 8.0 中
cell.countLabel.text =[nsstring stringwithformate:@"%d",indexpath.row+1];
【讨论】: