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?
相关问题
- JFX scale image up and down to parent
- NSOutlineView drag line stuck + blue border
- How to set the title of a menu in Android [duplica
- How can set pop-up menu position in QML
- Slide-out menu css only
相关文章
- Algorithm for maximizing coverage of rectangular a
- Is there a way to hide the new HTML5 spinbox contr
- Converting (u)int64_t to NSNumbers
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- PropertyGrid - Possible to have a file/directory s
- Programming a touch screen application with SWING
- “getter” keyword in @property declaration in Objec
- Can WM_NEXTDLGCTL be used with non-dialog windows?
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: