I have a menu item inside the main app menu and I’d like to route its action to a view controller (NSViewController
). The interface hierarchy looks like this: There’s a main app window controller by an NSWindowController
. Inside the window there’s a split view, and the right view in the split view is controlled by the NSViewController
.
Window + NSWindowController
`-- NSSplitView
`-- NSView
`-- NSView + NSViewController
The menu item is connected to First Responder in the Interface Builder. The view controller in question implements the appropriate method, but the menu item stays disabled. When I move the method to the NSWindowController
, the menu item gets enabled.
I figured I need to get the view controller to the responder chain, so I set it as the nextResponder
for the window controller; no cigar. What am I doing wrong?