Reputation: 9457
Specifically, I want to create a new NSWindow in IB in MainMenu.xib, but I don't want that to be open when the application launches. I tried doing close: and orderOut: in both the init and awakeFromNib methods of my NSWindowController class, but it flickers for a second before closing.
Upvotes: 7
Views: 3363
Reputation: 397
When working with Storyboards like me, be sure to also Uncheck the "Is initial Controller"
Checkbox at the "Window Controller Attributes"
tab. Because that Checkbox will cause the Window to always display and Ignore the "Visible at launch"
Checkbox.
Upvotes: 5
Reputation: 2140
open IB and uncheck "Visible at launch"
Then, use the following code in order to show it:
[window makeKeyAndOrderFront:self]
Upvotes: 2
Reputation: 46413
That's controlled by the "Visible at launch time" checkbox in the window inspector in interface builder.
See: The Nib Object Life Cycle.
Upvotes: 14