• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Finding myDocument from AppController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
References: 
 >Finding myDocument from AppController (From: John Nairn <email@hidden>)

  • Prev by Date: Re: NSBrowser firstResponder issue
  • Next by Date: Re: Finding myDocument from AppController
  • Previous by thread: Finding myDocument from AppController
  • Next by thread: Re: Finding myDocument from AppController
  • Index(es):
    • Date
    • Thread