• 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: makeWindowControllers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: makeWindowControllers


  • Subject: Re: makeWindowControllers
  • From: mmalcolm crawford <email@hidden>
  • Date: Wed, 2 Jul 2003 14:36:02 -0700

On Wednesday, July 2, 2003, at 12:36 PM, Brent Gulanowski wrote:

Docs don't say that overrides of -makeWindowControllers are supposed to call super's version, but if I don't, -windowControllerDidLoadNib does not get called. How non-intuitive is that? -windowControllerDidLoadNib gets called by the window controller, not the document! What's going on in NSDocument's default implementation of makeWindowControllers that I'm forgetting in my version? There is nothing apparently wrong with calling super's implementation, but in testing, I notice that it's trying to call -windowNibName. The docs make it sound like my version is replacing NSDocument's version, not augmenting it.

Since you're using multiple window controllers, it makes sense for each window controller to look after its own window -- that's what it's there for :-)

In your custom NSWindowController subclasses, override windowDidLoad, and put the controller logic there. In your case, for SCMainWindowController, perhaps:

-(void) windowDidLoad {

[[self document] createTextures];
}

(This is a cleaner implementation, avoiding the need to check for the WC's class...)

mmalc
_______________________________________________
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.

  • Follow-Ups:
    • Re: makeWindowControllers
      • From: Brent Gulanowski <email@hidden>
References: 
 >makeWindowControllers (From: Brent Gulanowski <email@hidden>)

  • Prev by Date: ProKit
  • Next by Date: Re: Static vs. Dynamic typing
  • Previous by thread: makeWindowControllers
  • Next by thread: Re: makeWindowControllers
  • Index(es):
    • Date
    • Thread