I try to understand a few things in Cocoa but I got stuck on one thing. I’m following Minimalistic Cocoa Programming, there it is a NSMenuItem responsible for terminating the app. Now, I would like to create another NSMenuItem, with a shortcut, that when pressed, it NSLog-s something. But I don’t know where should I put the implementation of said selector? Should I subclass the whole NSApplication? Should I setDelegate to some NSObject instance, acting as a controller?
I try to understand a few things in Cocoa but I got stuck on
Share
You need to create a class that can be used as the target of the menu item. Something like this:
Then set it as the target: