I'd like to programatically select a row in my NSTableView, with just one column.
func selectColumnIndexes(_ indexes: NSIndexSet!,
byExtendingSelection extend: Bool)
I have been playing around with this, but I am not sure how to write "Select row #2".
Do I have to start with the variable connected to the @IBOutlet
of my Table View? I have to indicate it is about my NSTableView somehow.
Thanks!
Okay, I've got it. It turned out to be
I couldn't quite figure out the part with
NSIndexSet
. I was fiddling around withinit()
, which turned out to be unnecessary.Swift 4 Solution
I created an extension to make a little easier to do this. Also if you implemented a click action on the table view cell this will invoke it as well
@Isaiah answer in Swift 3.0: