title: How to use NSWindowController to show a window in standard application?
body: <p>I created a new blank standard application using Xcode template. Removed the window in MainMenu.xib and I created a new customized NSWindowController subclass with a xib.</p>
  
  <p>They were named "WYSunFlowerWindowController.h" and "WYSunFlowerWindowController.m".</p>
  
  <p>And I append then init function like below:</p>
  
  <pre><code>- (id)init
  {
      NSLog(@"init()");
  
      return [super initWithWindowNibName:@"WYSunFlowerWindowController" owner:self];
  }
  </code></pre>
  
  <p>And my WYAppDelegate.m file is like below:</p>
  
  <pre><code>static WYSunFlowerMainWindowController* windowController = nil;
  
  - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
  {
      // Insert code here to initialize your application
      if (windowController == nil) {
          windowController = [[WYSunFlowerMainWindowController alloc] init];
      }
      [[windowController window] makeKeyAndOrderFront:windowController];
  }
  </code></pre>
  
  <p>And I have the problem, that the window can't show it self after I launch the app. Anyone can tell me why? Is anything wrong with my code?</p>
  
  <p>I am a newbie in Objective-C and cocoa. So I think I maybe make a silly mistake that I can't figure it out by myself.</p>
  
  <p>UPDATE:</p>
  
  <p>Here is my project source. Pleas have a look and help me to figure out what is my mistake。</p>
  
  <p><a href="https://dl.dropbox.com/u/3193707/SunFlower.zip" rel="noreferrer">https://dl.dropbox.com/u/3193707/SunFlower.zip</a></p>