I have two custom table views with two custom cells.
self.detourTblView.delegate = self
self.detourTblView.dataSource = self
self.dropDownLuggageTblView.delegate = self
self.dropDownLuggageTblView.dataSource = self
And this is how I fill data.
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if tableView == self.dropDownLuggageTblView {
let luggage_cell = tableView.dequeueReusableCell(withIdentifier: "luggage_cell", for: indexPath) as! LuggageCell
luggage_cell.luggageTypeTxt.text = luggageTypeList[indexPath.row]
return luggage_cell
}
if tableView == self.detourTblView {
let detour_cell = tableView.dequeueReusableCell(withIdentifier: "detour_cell", for: indexPath) as! DetourCell
detour_cell.selectionTime.text = detourSelectionList[indexPath.row]
return detour_cell
}
return cell
}
This gives me following error, Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier luggage_cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard' *** First throw call stack:
But I have given both identifiers in the storyboard. Why is this occur?