If I create a new project in xcode, there will be a main xib
In main xib there is an object called window.
I did an experiment where I remove the _window outlet from the automatically generated code.
@interface SDAppDelegate : NSObject <NSApplicationDelegate>
//@property (assign) IBOutlet NSWindow *window;
@end
I run the program and voila, that stupid window is still opened. The only way to make sure it’s not opened is by deleting the window.
What part of the code display window? How do the delegate knows which window to open?
I do not want to show any window when application launch. I may want to show some windows when applications select preferences, for example.
NSApp loads your main XIB, and the window in it is set to be visible on launch, so it is. None of your code is involved in this process at all.