Why is [self undoManager]
zero in a child window, in a doc-based app?
Should it not refer to the undo manager of its parent window? In the parent window, I get an actual address for the undo manager!
The undoManager
is not a member of NSWindowController.
This is just a NSDocument "feature".
An excerpt from the NSDocument docs : ... A document manages its window’s edited status and is set up to perform undo and redo operations. ....
Section "Subclassing NSDocument":
.... Subclasses are also responsible for the creation of the window controllers that manage document windows and for the implementation of undo and redo. ....
The code you've written won't work on other strongly typed languages because you would send a message to an object that doesn't exist. I'm pretty sure you should have a compiler warning here.
Hope this helps,
best,
Flo