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

Re: Passing References During Initialization / Nib Loading


  • Subject: Re: Passing References During Initialization / Nib Loading
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 11 Jun 2009 16:30:10 -0700

On Jun 11, 2009, at 15:53, Brad Gibbs wrote:

I had been manually instantiating the view controllers and passing references to the main window controller and the main managed object context with a custom init method ( initWithMoc: andWindowController:) and using these arguments to set variables in the view controllers. Today, I decided to try to refactor and clean up some code by instantiating the view controllers in nibs, but I ran into the problem I'm trying to describe.

It may just be prejudice, but I'm not a fan of putting window controllers or view controllers in nib files. And if your view controllers are all in the same nib, you lose the benefit of only instantiating the view controllers you need at any given time. Nevertheless ...


So you have a single window nib file? And a separate nib file for each view that can be displayed in the window "content" area? Are the view controllers in the window nib file? Somewhere else?

I still think the answer is likely to be that the objects in your view nib need to use mViewController.mainWindowController instead of mMainWindowController, and that your in-nib view controllers need an outlet connected to the main window controller (supplying the value of the view controller's mainWindowController property) instead of a plain instance variable.


_______________________________________________

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: 
 >Passing References During Initialization / Nib Loading (From: Brad Gibbs <email@hidden>)
 >Re: Passing References During Initialization / Nib Loading (From: Quincey Morris <email@hidden>)
 >Re: Passing References During Initialization / Nib Loading (From: Brad Gibbs <email@hidden>)

  • Prev by Date: Re: UTI not identified correctly for some users.
  • Next by Date: Re: Passing References During Initialization / Nib Loading
  • Previous by thread: Re: Passing References During Initialization / Nib Loading
  • Next by thread: Re: Passing References During Initialization / Nib Loading
  • Index(es):
    • Date
    • Thread