Passing References During Initialization / Nib Loading
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