YourWindowController* sheet;
[[NSApplication sharedApplication] beginSheet:[sheet window]
modalForWindow:[[NSApplication sharedApplication] mainWindow]
modalDelegate:nil
didEndSelector:nil
contextInfo:nil];
Make sure your window is created correctly. Make sure that the option "Visible at startup" in IB is not checked.
EDIT: I just noticed that you are loading this window from a separate nib file. Make sure you download it correctly. Use this:
YourWindowController* sheet = [[YourWindowController alloc] initWithWindowNibName:@"NameOfNibMinusExtension"];
and
Check and make sure that the “File Owner” type is set to your custom windowname class class and its “window” is set to a window in Nib.
Right-click (or Cmd + Click) on the File Owner and make sure that the "window" property is connected to the corresponding window. Also, make sure that the "Visible on Launch" window is NOT checked.
source
share