• 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: Instantiating window from nib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Instantiating window from nib


  • Subject: Re: Instantiating window from nib
  • From: Drew McCormack <email@hidden>
  • Date: Sun, 14 Oct 2001 10:59:07 -0700

I notice that NSWindowController has a method called
(id)initWithWindowNibName:(NSString *)windowNibName. This would make me
think that the correct way to handle this situation would be to subclass
NSWindowController rather than NSObject for my window controller object
in the NIB. I don't see any method in NSWindow or NSObject that would
allow me to create this window otherwise.

Is this the correct way to handle a window/windowcontroller in a NIB
outside the main one, or do I need to manually load the NIB somehow? Any
info is appreciated on doing this.

You do indeed subclass NSWindowController. You can use the 'init...' method you referred too, or you can override the 'windowNibName' method, and use a different init method. Even if you don't use the multiple-document architecture, you could start up a new MD project, and look at the methods which the window controller defines. These include some comments which may help you understand how it all fits together.

Drew McCormack


  • Follow-Ups:
    • Re: Instantiating window from nib
      • From: James DiPalma <email@hidden>
References: 
 >Instantiating window from nib (From: Jeff LaMarche <email@hidden>)

  • Prev by Date: Re: Cocoa Java vs Swing Java classes
  • Next by Date: Re: USB, interrupt pipes, and Siemens?
  • Previous by thread: Instantiating window from nib
  • Next by thread: Re: Instantiating window from nib
  • Index(es):
    • Date
    • Thread