Two choices:
- You can implement menu validation, see Apple's docs. In short before a menu is displayed the system sends a validation request to the same object that handles the action, which includes the first responder. You simply add a method to your document class which returns a
BOOL
; in your case yourisActionPossible
property. - Use the
currentDocument
property ofNSDocumentController
which returns the document associated with the main window. You can then use bindings to bind<Document Controller>.currentDocument.isActionPossible
. This approach is more general as you can bind label contents to values etc. as well as use it for menu bindings.