Re: Finding myDocument from AppController
Re: Finding myDocument from AppController
- Subject: Re: Finding myDocument from AppController
- From: Ondra Cada <email@hidden>
- Date: Thu, 16 May 2002 22:55:04 +0200
On Thursday, May 16, 2002, at 10:19 , John Nairn wrote:
In (my first) Cocoa app, I am now to the stage I want a menu command to
run a dialog box relevant to the document in the current window.
The normal way is to send an action by the responder chain, to be catched
and served by the appropriate document controller itself. Is there any
reason why you can't do that?
I added an AppController to the MainMenu.nib and set the target of a menu
item to an action in that class. I can find the current main window with
[NSApp mainWindow] and open a sheet on that window, but I do not see how
to access the class in the myDocument.nib from the AppContoller in
MainMenu.nib. I want the planned sheet to change some class variables in
myDocument.
There are no classes in a NIB, and there are no class variables in ObjC.
If I succeeded to translate your message to reality properly though, you
are after -[NSDocumentController currentDocument].
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.