I have a macOS app that contains a tableView. The tableView has 7 columns and is populated from a SQLite table. The tableView displays data for 6 of the 7 columns. On the last column I get the following error:valueForUndefinedKey:]: this class is not key value coding-compliant for the key itemUsedLast. The problem was in the following code:
When I comment out this code it works fine. Any thoughts on how to debug further?
Code Block func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) -> Any? { let identifier = tableColumn?.identifier // print(#function,identifier, items[row], identifier?.rawValue) let str = items[row].value(forKey: identifier!.rawValue) // let str = items[row].identifier!) return str }
When I comment out this code it works fine. Any thoughts on how to debug further?