user2417624
user2417624

Reputation: 693

Copy the content of NSTableView row or column using the default Copy menu item in Coca applicaton

I have several NSTableViews in different NSViewControllers. In my main application window I have a menu which has Edit->Copy command. This command is always disabled, so when I select a row or column in any of my NSTableViews, I can't use it.

Can anyone tell me how to enable the COPY menu item?

I have found this answer here but it didn't help. In all my NSTableViews,all text cells have the checkbox RefusesFirstResponder unhecked.

Also, just to mention that I have some custom menu items in the menu which works like a charm.

Upvotes: 3

Views: 1243

Answers (1)

Willeke
Willeke

Reputation: 15589

The copy command will be enabled if an object in the responder chain responds to the copy: message. The solution is to implement the copy: method in a controller which is in the responder chain like the viewcontroller or the windowcontroller.

Upvotes: 5

Related Questions