Hi there,
I have an app which when opened, displays a splash/loading screen. I had this set at 2.5 seconds before the app moved on.
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
sleep(2.5);
[window addSubview:viewController.view];
[window makeKeyAndVisible];
}
I now want the app to pause at the splash screen for a minute (there is a very good reason for this) so I thought:
sleep(60.0);
could be used. When I use this though, my app opens and stays at the splash screen for about 20 seconds, before quitting/crashing back to the springboard.
Any idea why this is the case?
How should I do this?
Edit // It is worth noting both:
sleep(15.0);
and
sleep(19.0);
work.
sleep(20.0);
does not.
Solution // Do not use sleep, use timer. I followed tutorial here:
http://adeem.me/blog/2009/06/22/creating-splash-screen-tutorial-for-iphone/
Many thanks,
Stu