tags:

views:

305

answers:

1

I have a NIB with two NSWindow objects. The controller class has two IBOutlets, one for each NSWindow (windowLogin and windowMain).

I only want one of the windows visible on launch. Insdide awakeFromNib I am using:

[windowMain orderOut:self];

which is having no effect. However, if I try:

[windowMain setTitle:@"Renamed Title"];

It works as expected. Thoughts?

+5  A: 

Look for the "Visible At Launch" property in the attributes inspector for the window in Interface Builder.

thesamet
I have then used [windowMain makeKeyAndOrderFront:self] as required.
mattdwen
However this a sure sign of a weak design. You will generally find in the long run that having one window per nib is a better idea. Create dedicated NSWindowController subclasses for each window/nib and have them load as needed.
Mike Abdullah