0
为什么下面的代码只显示1到17的单元格?indexPath.row从0到16而不是在
internal func tableView(_ tableView: UITableView,numberOfRowsInSection section: Int) -> Int {
return 20
}
internal func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = UITableViewCell(style: UITableViewCellStyle.default, reuseIdentifier:"Cell")
cell.textLabel?.text=String(indexPath.row+1)
print(indexPath.row)
return cell
}`
吓人。清理,删除派生数据并重试。 – shallowThought