Lenny Magico
Lenny Magico

Reputation: 1203

Xcode Run IBAction when app loads

I would like to hide a window before the app has loaded. Now I know to hide a window you can use this;

[window2 orderOut:nil];

which works fine when you click on a button but what if I wont it to be hidden before or whilst the application has loaded?

So sorta need an IBAction on when the application loads

Upvotes: 0

Views: 411

Answers (1)

mipadi
mipadi

Reputation: 410562

In Interface Builder, you can uncheck the box (in the window's attributes pane) that says to show the window at startup.

Or you can put that line of code in your app delegate's applicationWillFinishLaunching (or perhaps applicationDidFinishLaunching) method. (Might not work in the first one, I'm not sure.)

But I'd go with the first option, personally.

Upvotes: 1

Related Questions