我正在开发一个具有用户创建部分的应用程序, 我在 Storyboard上的表格 View 中创建了帐户。
如果我当时运行模拟器,我会看到所有的桌面 View ,一切都很好。 但是一旦我附加一个扩展 UITableViewController 的类, 我在模拟器中运行所有内容 屏幕是空的,没有任何字段。 我究竟做错了什么 ? 我需要寻找什么?
如果我空运行它,我会在模拟器中看到一切都很好>
但是一旦我添加了类,我就看不到任何东西,只有空字段>
谢谢
最佳答案
已修复 通过将我的 Tableview 方法修改为:
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
print ("section: ", section)
if (section == 0) {
return 4
} else if (section == 1) {
return 1
} else if (section == 2) {
return 4
} else if (section == 3) {
return 2
} else if (section == 4) {
return 1
} else if (section == 5) {
return 3
} else if (section == 6) {
return 1
} else if (section == 7) {
return 1
} else {
return 0
}
}
关于ios - 将类从 Storyboard附加到 TableView 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53083702/