Error: "Unexpected nil index path in _canPerformAction:forCell:sender:, this should never happen."
I have a dynamic tableView with 2 prototype cells. I using one of the cells for section header, the section header cell has it's own class. Data have been populated to these cells without problems.
I am getting this error message at runtime, and when I tap on the section header. Anyone knows how to get rid of this error? Thanks in advance
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "MachineTableViewCell") as! MachineTableViewCell
if self.uptime.count == self.machines.count {
cell.GPUNumber.text = self.allGPUNumber[indexPath.section][indexPath.row]
}
return cell
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
/
guard let header = tableView.dequeueReusableCell(withIdentifier: "header") as? HeaderTableViewCell
else {
return nil
}
let machine = machine[section]
header.name.text = machine.name + " - " + machine.ip + ":" + machine.port
return header
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat
{
return 124
}