Search code examples
cocoansapplicationmainwindow

Start Cocoa app without showing the main window


I have a simple Cocoa app with a single NSWindow where I can enter some credentials and after the submission the app starts an another process. In case the credentials were entered once and cached I would like to start the process by running the app without showing the app's main window. How can I achieve that?

The app has only one class that conforms to NSApplicationDelegate and one .xib file.


Solution

  • Is your window created from a xib file? There should be a "Visible at launch" checkbox in the properties for the window.

    You'll need some other UI (such as a menu item) to start your work going — or you could put that in applicationDidFinishLaunching:.