I'm loading interfacetable values from context send from iOS application. The data passing was successful but the tableview method
rowController(at: index)
Is returning nil Value and numberOfRows variable was still 0 after line of code
tableView.setNumberOfRows(3, withRowType: "deviceRow")
My overall code is
func setupTable() {
tableView.setNumberOfRows(devicesArray.count, withRowType: "deviceRow2")
for (index, device) in self.devicesArray.enumerated() {
if let row = tableView.rowController(at: index) as? MeasurementCell {
row.deviceNameLabel.setText(device)
row.readingLabel.setText(self.readingsArray[index])
let statusColor = colorWithHexString(hex: self.colorsArray[index])
// row.backgroundGroupView.setBackgroundColor(statusColor.withAlphaComponent(0.2))
row.readingLabel.setTextColor(statusColor)
row.dateLabel.setText(self.datesArray[index])
row.readingLabel.setTextColor(self.getColor(fromString: self.colorsArray[index]))
row.readingLabel.sizeToFitWidth()
}
}
Is there any workaround for the issue? Suggestions are highly appriciated.