title: How show sheet loaded from xib? (MacOSx)
body: <p>I have a xib file with only an NSPanel in it, I'm trying to show this panel as modal sheet (with <code>beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:</code>). The file's owner for this xib is a controller class "MyController" which has the IBOutlet to the NSPanel.</p>
  
  <p>What I am looking for is something like:</p>
  
  <pre><code>...
  MyController *controller = [[MyController alloc] init];
  
  [NSApp beginSheet:controller.panel modalForWindow:[NSApp mainWindow] modalDelegate:controller didEndSelector:nil contextInfo:nil];
  ...
  </code></pre>
  
  <p>Question:
  Must MyController inherit from <code>NSWindowController</code> or <code>NSObject</code>?. I tried <code>NSWindowController</code> and <code>initWithWindowNibName:</code> but the outlet to <code>NSPanel</code> always is nil.</p>
  
  <p>Thanks</p>