0

I've got two NSTableView in a single NSViewController, and each has their own NSArrayController to handle what exists. I'm now trying to wire up the Edit->Delete button. How do I know, when the delete method is called, 'who' sent that message?

Specifically I want to know whether I was clicked into the first table view or the second one when I then chose the Delete menu item. The 'sender' to the delete method is just the NSMenuItem so I can't back-track that to the table.

Gargoyle
  • 9,590
  • 16
  • 80
  • 145
  • Usually you'd hook up the delete button to the NSArrayController. – Gerd K Jun 02 '16 at 03:08
  • Can you give a little more specifics on how that's done please? Since I have two array controllers, I'm not sure how to link things. This is my first Cocoa app...I normally do iOS. – Gargoyle Jun 02 '16 at 04:23

1 Answers1

0

Get firstResponder of the window and follow nextResponder until you find a table view.

Willeke
  • 14,578
  • 4
  • 19
  • 47