• 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: Why NSWindowController for non-document windows?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why NSWindowController for non-document windows?


  • Subject: Re: Why NSWindowController for non-document windows?
  • From: email@hidden (Stefan Haller)
  • Date: Tue, 13 Sep 2005 15:20:23 +0200
  • Organization: Ableton

Of course, I *am* using nib files other than the main nib already.  But
I can either do this by deriving my window controller from NSObject,
using

  [NSBundle loadNibNamed:@"NibName" owner:self];
  [mWindow makeKeyAndOrderFront:self];

(where mWindow is an outlet of my controller which is connected in
Interface Builder), or by deriving from NSWindowController, using

  [self initWithWindowNibName:@"NibName"];
  [self showWindow:self];

I wonder why the second method is considered preferable to the first.



Fabian Spillner <email@hidden> wrote:

> You could use NSWindowController to load other nib files.
> Now you wonder why to create other nib files?
>
> If your app has ex. preferences window which
> isnt always used by user. It would be better
> if the app loads only the necessary gui
> and so the app can be started faster.
>
> the gui of preferences window is saved in other nib file.
>
> Your app can load the other nibs, if needed.
>
>
>
> On 9/13/05, Stefan Haller <email@hidden> wrote:
> >
> > I seem to remember having read the recommendation to derive your
> > controllers for non-document-based windows from NSWindowController too.
> > I wonder why?
> >
> > Until now I derived those controllers from NSObject, which seems to have
> > worked fine so far. Just out of curiosity, I tried changing one to
> > NSWindowController, seeing what it would buy me; but it only seems to
> > create problems:
> >
> > 1) The auto-save name defined in the nib is no longer used; I have to
> > set it programmatically.
> >
> > 2) The auto-saved size and position is only used for the first window I
> > open; any further windows use the frame defined in the nib. I may be
> > doing something wrong here, but the auto-save name works just fine
> > without further work from me if I derive the controller from NSObject.
> > (See also
> > <http://www.cocoabuilder.com/archive/message/cocoa/2004/11/9/121184>).
> >
> > Any insight is greatly appreciated.
> >
> >
> > --
> > Stefan Haller
> > Ableton
> > http://www.ableton.com/


--
Stefan Haller
Ableton
http://www.ableton.com/
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Why NSWindowController for non-document windows?
      • From: glenn andreas <email@hidden>
References: 
 >Re: Why NSWindowController for non-document windows? (From: Fabian Spillner <email@hidden>)

  • Prev by Date: NSUserDefaults not resetting....
  • Next by Date: Re: Why NSWindowController for non-document windows?
  • Previous by thread: Re: Why NSWindowController for non-document windows?
  • Next by thread: Re: Why NSWindowController for non-document windows?
  • Index(es):
    • Date
    • Thread