• 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: Communicate two window controllers.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Communicate two window controllers.


  • Subject: Re: Communicate two window controllers.
  • From: Andreas Mayer <email@hidden>
  • Date: Mon, 24 Sep 2007 02:30:31 +0200


Am 24.09.2007 um 00:44 Uhr schrieb Jere Gmail:

Is there anyway to access the B controller directly?

Yes. You store a reference to B someplace where you can reach it from A.

Exactly *where* depends on the case at hand.

If B is somehow dependent on A, you might want to store the reference there.
If both windows are largely unrelated, you could store it in the application delegate.


An object that is always accessible in a Cocoa application, is the application object itself:
[NSApplication sharedApplication] or NSApp which is a shortcut for this.


Almost all Cocoa applications have a delegate which, in turn, you get with:
[NSApp delegate]


This is an excellent place to keep track of application global objects.

Thus you'd get the B controller using [[NSApp delegate] bController] from anywhere inside your application.


Andreas _______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Communicate two window controllers. (From: "Jere Gmail" <email@hidden>)

  • Prev by Date: GraphKit: Please file bugs to get at least a preview SDK.
  • Next by Date: Programmatic firewall configuration
  • Previous by thread: Communicate two window controllers.
  • Next by thread: Console: *** -observeValueForKeyPath:... only defined for abstract class
  • Index(es):
    • Date
    • Thread