Here is the ViewController code for a test project that demonstrates the issue I'm having with my actual project:
(Is there a way to attach the entire Xcode project?)
`//
// ViewController.swift
// TEST
//
// Created by Phil Bond on 9/13/21.
//
import Cocoa
class ViewController: NSViewController, NSTableViewDelegate, NSTableViewDataSource {
var infoForTableView : [String] = ["one", "two", "three", "four", "five"]
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override var representedObject: Any? {
didSet {
// Update the view, if already loaded.
}
}
@IBAction func cellWasEdited(_ sender: NSTextFieldCell) {
print("cell was edited")
print(sender.stringValue)
}
func numberOfRows(in tableView: NSTableView) -> Int {
return infoForTableView.count
}
func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) -> Any? {
return infoForTableView[row]
}
}
`