Mon 28 Apr 2003 10:15:20 AM UTC, comment #3:
No - the methods should be implemented only in NSDocument.
There is a precise reason for this - when you subclass
NSDocument, you might want to add new methods other than save/close. Those methods should be immediately available
to the main menu without the need of wrapping them manually
in NSWindowController/NSDocumentController.
It fits in the general philosophy that actions of the active
objects are activated and can be called directly from the menu. That makes simple to add new actions to objects which
can be active, and new menu items calling those actions without modifications of other parts of the software.
The problem you are having is definitely due to not setting
up correctly the various connections required in NSDocument-base applications. Those connections are
confusing to set up; Apple seems to have targeted too much flexibility at the expense of simplicity.
Without source code of what you have done, it's difficult
to guess what needs changing, so I'll point you to examples
instead:
I'm not sure if Ink (gui-only version) is right - it's a while I don't look at it; but the Renaissance version
of Ink (included in the Renaissance example applications)
is definitely right and it works (on both GNUstep and
Apple OS X).
Renaissance also uses both a customized NSDocument and NSWindowController in order to support loading nib files
from .gsmarkup rather than .gorm; you might take that as
an example of using both customized.
Else, if you still can't figure out how to set up the
connections properly, please submit the code you are using.
|