In my macOS application I have menu items, which are replicated also in main UI. Application is consisted of main window with its delegate and single view along with its view controller. In app delegate I capture menu item click action, then I need to send this event to my view controller in order to take appropriate actions and also update main UI.
Question is how to access my view controller (NSViewController
) from app delegate?
Actually you don't need a reference to the controller. There is First Responder
IBActions
The action will be executed in the first object of the responder chain which implements the action.