Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jimhanika

macrumors newbie
Original poster
Jun 3, 2006
15
0
London
I would like to pause the initial opening just for effect. A simple splash screen, if you will. Does anybody know if this is possible?
 

DipDog3

macrumors 65816
Sep 20, 2002
1,191
812
I would like to pause the initial opening just for effect. A simple splash screen, if you will. Does anybody know if this is possible?

Just load more stuff when your program starts and that will allow the Default.png to display longer.
 

RossOliver

macrumors regular
Nov 6, 2006
157
0
I would like to pause the initial opening just for effect. A simple splash screen, if you will. Does anybody know if this is possible?

You could try adding:

Code:
sleep(2);

To your applicationDidFinishLaunching method...

-Ross
 

admanimal

macrumors 68040
Apr 22, 2005
3,531
2
What you want to do is add:

[NSThread sleepForTimeInterval:numberOfSeconds];

as the first line in your applicationDidFinishLaunching method in the app delegate.
 

keehun

macrumors regular
Mar 17, 2008
110
0
Or have everything load, but add a subview of the image to fill up the screen, set up the timer, after 2 seconds, within the callback, remove the splashscreen from the superview and then it goes.

Sleeping, I think is a bad idea.
 

ayasin

macrumors 6502
Jun 26, 2008
318
0
Why? All it does is pause your app's process. The user can still go back to the home screen.

I don't think they can. When they push the home button it posts a quit message to your message queue. Since the thread that's processing your message queue will be frozen (sleeping) it won't process the message until it wakes up and finishes processing the current one. If the home button just killed you, you wouldn't get the applicationWillTerminate message. In general it's a bad idea to sleep in UI threads (or do much of anything time consuming) as it blocks all other UI actions.
 

keehun

macrumors regular
Mar 17, 2008
110
0
Yes. It just creates a really bad user experience, and your users will have to wait for everything to load once those 2 seconds of hell are over. Why not have your splash screen AND load stuff at the same time. Such a better deal.
 

admanimal

macrumors 68040
Apr 22, 2005
3,531
2
Yeah you guys are right. When I tried out the code I thought I was able to use the Home button, but I guess I just happened to press it after the sleep was over. I just tried it again with a longer sleep time and the Home button was useless.
 

jimhanika

macrumors newbie
Original poster
Jun 3, 2006
15
0
London
Sleep or no sleep

Hi All,

What a great conversation this has been!

My original idea was to add a temporary view as a startup that showed an app name, legal and version details etc, and then I realised that the default.png could do that without the added programming, as it loads anyway, hence the question.

I am working on a database app, and it will not end up as a very large app at all, so sleeping for 1 or 2 seconds is hardly a problem, as the app will load immediately after.

In saying that, I have another version that changes views, which is good for transition control. We'll see.
 

Luke Redpath

macrumors 6502a
Nov 9, 2007
733
6
Colchester, UK
Have the posters in this thread read the iPhone Human Interface Guidelines?

Given the OP and some of the responses, I guess it's worth pointing out that the iPhone Human Interface Guidelines explicitly advises agsint using the launch image as a splash screen, about screen etc.:

It’s important to emphasize that the reason to supply a launch image is to improve user experience; it is not an opportunity to provide:

* An “application entry experience,” such as a splash screen
* An About window
* Branding elements, unless they are a static part of your application’s first screen

I can imagine games might be an exception (it doesn't really make sense to display a fake interface for games and they tend to take longer to load) and Apple themselves use a splash screen for the Texas Hold'em game. But for normal apps, and in general, I recommend following Apple's HIG. Creating an artificial pause to display the screen for longer seems especially bad for me as it impacts on the user experience - don't make people wait for your apps to load.
 

keehun

macrumors regular
Mar 17, 2008
110
0
Good point from the HIG. Not only is it so annoying, but sleeping the thread is just a bad idea. No matter how big or small the project is. There are definitely other methods. And I don't think you need a splash screen. It seems awesome but when you actually sit down and think, its so unnecessary. Heh, I used to put a really annoying splashscreen to every app I made when I was like 12 or 13, but I now don't even know why I did that. :)
 

jimhanika

macrumors newbie
Original poster
Jun 3, 2006
15
0
London
Nobody reads the manual! Or do they?

I did read this, strangely, but like you I noticed that not even Apple follow it to the letter.

In our tests and reviews here we didn't see any problem in seeing a 1 or 2 second delay in the startup, because everything is ready to work on the third second in. It really didn't present the type of problem some of the other posters thought it would. A more complex load up would be painful, I think, as you would have the slight delay, and then another delay while it loaded the app. Any longer than 2 seconds is too far, I agree, even for our lightweight app.

We sat and went through all of the collective apps we have on our iPhones and found a few with a quick startup image. Most go straight into the initial window.

Unlike your average application on the Mac, which use startup panels, an app on the iPhone assumes a much simpler form, and the initial screen is largely ignored by the majority. Our third idea is to have an info button that shows a subview, which is likely to be the way we will go, I think
 

keehun

macrumors regular
Mar 17, 2008
110
0
I guess if it works as you want it's fine, but I can assure you non of them sleep the thread. :)
 

mekopolis

macrumors regular
Feb 10, 2008
152
0
ive noticed companies like EA and gameloft now using 2 second videos, animated or still, they are movies
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.