PDA

View Full Version : can I pause the default png for a second or two at startup?




jimhanika
Aug 21, 2008, 03:00 PM
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
Aug 21, 2008, 03:15 PM
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
Aug 21, 2008, 03:34 PM
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:


sleep(2);


To your applicationDidFinishLaunching method...

-Ross

admanimal
Aug 21, 2008, 03:49 PM
What you want to do is add:

[NSThread sleepForTimeInterval:numberOfSeconds];

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

keehun
Aug 21, 2008, 09:29 PM
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.

admanimal
Aug 21, 2008, 09:54 PM
Sleeping, I think is a bad idea.

Why? All it does is pause your app's process. The user can still go back to the home screen.

ayasin
Aug 21, 2008, 10:21 PM
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
Aug 21, 2008, 10:48 PM
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
Aug 21, 2008, 10:49 PM
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
Aug 22, 2008, 06:35 AM
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
Aug 22, 2008, 08:30 AM
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
Aug 22, 2008, 09:24 AM
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
Aug 22, 2008, 09:36 AM
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
Aug 22, 2008, 01:01 PM
I guess if it works as you want it's fine, but I can assure you non of them sleep the thread. :-)

mekopolis
Sep 11, 2008, 02:54 PM
ive noticed companies like EA and gameloft now using 2 second videos, animated or still, they are movies