Current Document
Current Document
- Subject: Current Document
- From: SWC <email@hidden>
- Date: Wed, 17 Oct 2001 00:40:43 -0400
I'm writing my first multi-doc application, and think I have a pretty
good grasp on most of the process, but am getting slightly hung up on
messages which are to be routed to the current doc, whatever that may
be. As an example, I have a command in the MainMenu.nib file which I
want to get passed to the currently selected document.
I notice that the DocumentController class has a currentDocument method
which seems to be what I'm looking for, but I am having trouble figuring
out how to get ahold of the document controller. Is this the wrong way
to go? I also see that NSApp provides a mainWindow method and a
ketWindow method, but I dont see how to get from a given window, to the
NSDocument it belongs to.
Could someone help me out here? It seems this should be really
straightforward, as the need for this must come up fairly often. Am I
overlooking something obvious?
Thanks alot,
Spencer