Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 946
Don Grem Avatar asked Nov 29 '11 15:11

Don Grem


2 Answers

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

like image 115
Amy Worrall Avatar answered Sep 23 '22 08:09

Amy Worrall


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

like image 25
Joshua Nozzi Avatar answered Sep 26 '22 08:09

Joshua Nozzi