splash image


i want to display splash image when user click on my application’s icon.

i have window by name of “splash screen” i want to display this image when user click on my app icon.

pls suggest.


OK, i’m not in the habit of giving everything chewed up. So let’s take a constructive approach:

What do you need to show a window? First, you need an acton method that will be called when the user clicks something. Second, you need to show the window.

In the first case, I think you can get that working, it’s pretty simple. For the second, since it is an NSWindow object that you want to display, look into the Dev Documentation for this class, there should be something available.

With this you should be able to achieve what you want.

Model: MacBookPro8,2
Browser: Safari 534.51.22
Operating System: Mac OS X (10.7)

thank you for your reply.

i want to display splash window for 3 second when user click on my application icon.

how can we do that??

Also, please don’t make multiple posts on the same topic. This looks like the same question as you posted before under the title of “show image”. If, after a few hours, you don’t get a response, you can post a response to your own post asking for help again, and maybe giving more information.


thanks you ric,

i will follow your advise.

i know i am asking stupid questions. but can u please let me know how to display splash screen when user clicks on my app icon.

thanks again.

For delays, use NSTImer or performSelector:withObject:afterDelay: from NSObject. You will find plenty of posts about those 2 if you search just a bit in these forums…

Model: MacBookPro8,2
Browser: Safari 534.51.22
Operating System: Mac OS X (10.7)

And what do you mean by your “app icon”? The one in the finder? Or you have an NSImage object in your window with your app’s icon?

the one in the finder.

when user install my application and click on application icon then i want to show splash screen for 3 seconds.

thank you.

Ok, so what have you tried so far? Did you look in the docs for a method to display the window?

I have used orderOut to display window.

but i want to close this window after 3 seconds, i have looked in NSTimer class and found that it can be done with

“scheduledTimerWithTimeInterval” but got confused.

can u please show me the way??

Here is a thread about NSTimer and performSelector:withObject:afterDelay in ASOC:

How exactly to use NSTimer in ASOC?

orderOut is to remove the window from view, as mentioned in the docs:

which you will need after the 3 seconds have elapsed.

You need something more like makeKeyAndOrderFront: to make it appear.

Don’t use NSTimer. Use performSelector:withObject:afterDelay: it is plenty enough for what you need to do.

The other thing you need to be aware of is what makes your main window appear automatically when the app starts up? In IB if you click on your main window, you will see a check box labeled “visible at launch” in the Attributes pane of the inspector – it is checked by default. So, to do what you want to do, you need to uncheck that for your main window, but leave it checked for your splash screen window. Then you can use orderOut: and makeKeyAndOrderFront: to make the splash screen go away and the main window appear.