I am creating a table, and using this code to generate the cells:
let cell2:iPRoutineSpecificCell = self.routineSpecificsTable.dequeueReusableCell(withIdentifier: "Cell2") as! iPRoutineSpecificCell
The cell contains a label. When i say
cell2.label.text = "Test"
return cell2
I get the error:
fatal error: unexpectedly found nil while unwrapping an Optional value
I have this exact arrangement elsewhere in the app and it is working fine. Why is it not working this time? The only difference between the two views is that this one contains two tables. However, if i use:
cell2.textLabel?.text = "Test"
Then it works.
Any help appreciated!