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