title: NSWindowController: loadWindow loads window from nib but showWindow: does nothing
body: <p>I have an NSWindowController subclass called <code>_PreferencesWindowController</code> with the following implementation -</p>
  
  <pre><code>@synthesize window;
  
  - (id)init {
  
   self = [super initWithWindowNibName:@"PreferencesWindow"];
   if (!self) return nil;
  
   return self;
  }
  </code></pre>
  
  <p>And I tried to show the window in <code>_PreferencesWindowController</code> by using the following code -</p>
  
  <pre><code>_preferencesWindowController = [[_PreferencesWindowController alloc] init];
  [_preferencesWindowController showWindow:nil];
  </code></pre>
  
  <p>It does nothing, and I checked <code>_preferencesWindowController.window</code> is <code>nil</code> from the debugger.</p>
  
  <p>However if I call <code>loadView</code> on <code>_preferencesWindowController</code> the window can be loaded and is visible; <code>_preferencesWindowController.window</code> is no longer nil-valued -</p>
  
  <pre><code>[_preferencesWindowController loadWindow];
  </code></pre>
  
  <p>I looked at Apple's documentation on NSWindowController it specifically says "you should never directly invoke <code>loadWindow</code>", instead <code>showWindow:</code> should be used. I'm wondering what I might have missed that resulted in the above-mentioned behaviour I have been seeing.</p>