我有一个视图控制器
class PlacesVC: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
// MARK: - Table view data source
override func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 4
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = UITableViewCell(style: .default, reuseIdentifier: "Cell")
cell.textLabel?.text = "Row \(indexPath.row)"
return cell
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
performSegue(withIdentifier: "toMap", sender: kill)
}
}
我也有该单元格的ID作为
Cell
在构建和运行应用程序时,我一直在清空表
我希望得到这样的4行。
如何调试为什么我的行没有显示?
最佳答案
您需要在Storyboard上的ViewController
的Identity Inspector部分中设置您的类。
关于ios - 如何调试UITableView不显示行?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52951024/