我更新了Xcode,此后我的数据库出现问题。 代码:'UITableView'未能从其dataSource获取单元格
override func numberOfSections(in tableView: UITableView) -> Int {
// return the number of sections
return 1
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
{
// return the number of rows
return leadItems.count
}
func cellForRow(at indexPath: IndexPath) -> UITableViewCell?
{
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! LeadsTableViewCell
// Configure the cell...
cell.user_name_label.text = leadItems[indexPath.row].user_name
cell.school_name_label.text = leadItems[indexPath.row].school_name
return cell
}
错误,我得到的是:
终止应用程序由于未捕获的异常 'NSInternalInconsistencyException',原因:“的UITableView(;层=; contentOffset:{0,-64} ; contentSize:{375,65802}>)未能从其DataSource()
cellForRowAtIndexPath返回零 –