I have a table, when I create some rows with changed text it's doesn't show in the App.
var items : [String] = []
override func viewDidLoad() {
super.viewDidLoad()
items.append("Apples")
items.append("Oranges")
tableView.reloadData()
}
func numberOfRows(in tableView: NSTableView) -> Int {
return items.count
}
func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) -> Any?{
let result : NSTableCellView = tableView.make(withIdentifier: tableColumn!.identifier, owner: self) as! NSTableCellView
print(tableColumn?.title)
result.textField?.stringValue = items[row]
print(result.textField?.cell?.title)
return result
}
}
In console it looks ok, but it shows previous values
By default the Log column's textfield = 1 and date = 2
I got it. I've changed the type to cell-based and the tableView funtion.