InterfaceBuilder NSButton connect to NSViewControl

2019-08-03 12:10发布

问题:

I have a view-based NSTableView whose "file's owner" is the ViewController. I dragged a button(for deletion) on the custom NSTableCellView, so I want to click the button and delete the current row from tableView, but when add a row the debug console tells me "Could not connect action, target class NSObject does not respond to deleteAction:"

I m using the NSArrayController binding the NSTableView(add action is triggered successfully). I also got another weird problem, I try to subclass NSTableCellView and set the cell's "Custom Class" to MyTableCellView but I can not connect the button to my MyTableCellView.