In my application, I save user preferences and one of the preferences is whether to show any NSMenuItem
s as buttons in the home window. I don't have problems to create the buttons dynamically, but I can't pass the action of the NSMenuItem
to the NSButton
. I have already tried:
[newButton setAction:[theItem action]];
UPDATE
I just have to set the target as self
[newButton setTargert:self];
And move the code to the class that send the action to the NSMenuItem
Check the following: