I've a single window Document-based application that loads several NSViewControllers that serve as the main view. Each view controller is a self-contained class that deals with certain business needs and as such implements all methods necessary to work.
My problem is how to make the toolbar work when a specific view controller is loaded. I've no problems wiring the toolbar to a delegate and the toolbar items to actions as long as these are implemented in the window class. But if I try to set a new action for a toolbar item on the loadView
method of a view, the toolbar item simply ignores it and continues calling the method on the main window class.
So, how can I dynamically change the action on a toolbar item?