I’ve been trying to expand a bit on this chapter by putting a remove button into each cell rather than beside the table. This seems like it should be very easy, but I’ve had no success.
The issue is that no matter what target I assign to the button, xCode complains (via a warning) that the connected action is an invalid target and clicking on the button(s) in the cells has no effect (my target action is never called). A good, working example (though significantly more complex than I need) can be seen in Apple’s example code “TableViewPlayground” linked to the Table View Programming Guide.
To eliminate as many potential issues, I created a most basic project (not Core Data, not Document-Based - tried with and without ARC). In IB, I added a single-column, view-based NSTableView to the window. I then added an NSButton to the cell titled (the Action button).
In the app delegate interface, I added an IBAction:
and its implementation just logs a message. Next, in IB, I control-drag from the Action button to my app delegate and select the btnAction as the received target. xCode shows a warning that says:
I’ve Googled everything I can, crawled Stack Overflow, and searched Apple’s documentation but cannot figure out how to make this work. If I can get the action from the button, I know what to do. Any help would be greatly appreciated…