• 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: Jeff LaMarche <email@hidden>
  • Date: Mon, 15 Oct 2001 22:44:42 -0700

On Monday, October 15, 2001, at 10:51 AM, James DiPalma wrote:
Are there advantages to using NSWindowController? Its design seems to provide many of its features for NSDocument (or any document) window: all of the relevant features in the doc can easily be done in IB for a non-document window. Using an NSWindowController simply to load a nib file seems like an unnecessary introduction of a somewhat confusing class.

Well, as the person who asked the original question, I'm certainly no expert here, but NSWindowController does seem to provide some additional functionality that is useful, although not particularly hard to implement yourself. For one thing, it automatically cascades new windows, and stores window size and location information in the user defaults, restoring them the next time. These are obviously things primarily intended for the document based application, but they can be useful in other situations.

Using NSBundle to load a nib file seems to be easier for a non-NSDocument based application. I would also recommend against NSWindowControllers for things like inspectors, preferences and stuff like that.

I wouldn't say easier, but probably more efficient - NSWindowController gives you a lot of stuff you might not need if you're not creating a multi-document application. It's hard to argue easier when NSWindowController does things you would have to code for otherwise.


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

  • Prev by Date: Re: setting the value of a Text View
  • Next by Date: A Stupid Question
  • Previous by thread: Re: Instantiating window from nib
  • Next by thread: Re: Instantiating window from nib
  • Index(es):
    • Date
    • Thread