• 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
Passing References During Initialization / Nib Loading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Passing References During Initialization / Nib Loading


  • Subject: Passing References During Initialization / Nib Loading
  • From: Brad Gibbs <email@hidden>
  • Date: Thu, 11 Jun 2009 11:52:01 -0700

Hi,

In short, I need a more reliable way to pass references to my MainWindowController into objects that are awaking from nib files. Trying to set the mMainWindowController variable to self.view.window.windowController in the awakeFromNib method seems to be happening before the MainWindowController is instantiated, so, it sets the variable to NULL.

I need to call a method in the MainWindowController to switch views / viewControllers, passing in the new viewController as an argument. I can set the mainWindowController variable in the method that actually invokes the view switch, but that seems clunky. It seems like there should be a method I can call to set the variable once the view controller has awoken and the app has fully loaded. initWithCoder and awakeFromNib happen too soon and applicationDidFinishLaunching only gets sent to the app delegate.

Is this a good case for a singleton object?

Is there something I'm missing?

Thanks.
_______________________________________________

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


  • Follow-Ups:
    • Re: Passing References During Initialization / Nib Loading
      • From: Quincey Morris <email@hidden>
    • Re: Passing References During Initialization / Nib Loading
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Photoshop plugin with Cocoa UI problems
  • Next by Date: Re: Passing References During Initialization / Nib Loading
  • Previous by thread: Re: Get application path by Bundle ID
  • Next by thread: Re: Passing References During Initialization / Nib Loading
  • Index(es):
    • Date
    • Thread