Launch the Cocoa app without showing the main window

I have a simple Cocoa application with one NSWindow, where I can enter some credentials, and after sending the application starts another process. If the credentials were entered once and cached, I would like to start the process by launching the application without showing the main application window. How can i achieve this?

An application has only one class that corresponds to an NSApplicationDelegate and one .xib file.

+6
source share
2 answers

Is your window created from an xib file? In the properties for the window must be checked "Visible at startup".

You will need a different user interface (for example, a menu item) to get started - or you can put it in applicationDidFinishLaunching:

+5
source

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

+2
source

Source: https://habr.com/ru/post/902662/


All Articles