Document.xib と MainMenu.xib、およびクラス MainController があります。NSObject をオブジェクト ライブラリから Document.xib のインスタンス ツリーにドラッグし、プロパティのクラスを MainController に設定して、MainController のインスタンスを Document.xib に追加しました。ボタンを追加し、それを MainController が提供するアクションの 1 つに接続しました。
So far, so clear. Now I basically want to call the same action from a menu item. Obviously, I can't just add another instance of MainController to the MainMenu.xib, because I'd end up with two instances. There should be just one per document, and the menu item should call the action in the active document's MainController. How do I do this?