tkowal
tkowal

Reputation: 9299

How to prevent displaying window on application startup osx

I am learning Objective-C and programming applications for OS X. I want to write myself a simple notifier, which should work this way:

I thought, that I will add my app to startup and if there are no changes on the website - just terminate it. But the window with action buttons will pop up before application checks, if there is a new content and window will flash quickly. How do I prevent that?

Is there a better way to create something like this? For example instead of running my application during startup - running a daemon, that will check the website every 24 hours and then display the window? How can I do that?

Recently, I read Start Developing Mac Apps Today, so I might be still missing something obvious.

Upvotes: 0

Views: 776

Answers (1)

El Tomato
El Tomato

Reputation: 6707

Select NSWindow and just turn off Visible At Launch.

If you want to show the window, do it manually as follows.

- (void)applicationWillFinishLaunching:(NSNotification *)notification {
    /* Do whatever necessary before the window appears */
    [window setIsVisible:YES];
}

Personally, I never have the Visible-At-Launch switch on.

enter image description here

Upvotes: 1

Related Questions