Don Grem
Don Grem

Reputation: 1267

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.

Upvotes: 8

Views: 2640

Answers (2)

Amy Worrall
Amy Worrall

Reputation: 16337

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:.

Upvotes: 7

Joshua Nozzi
Joshua Nozzi

Reputation: 61228

In your MainMenu.xib file, select the window and uncheck "Visible at launch". I believe this is all you need to do.

Upvotes: 2

Related Questions