I'm new to IOS development.
I set a Default.png file, and it is shown every time when the app enter foreground from background, but I just want Default.png is shown once when the app launch.
I'm new to IOS development.
I set a Default.png file, and it is shown every time when the app enter foreground from background, but I just want Default.png is shown once when the app launch.
On
Go to your Info.plist file in your project and look for this key:
UIApplicationExitsOnSuspend
make sure it is set to FALSE, or, in plist speak, <false/>
And here's a list of keys for UIKit on Apple's site, which includes the one I just referred you to.
On
The Default.png is only used when your App is launched, not when your App is resumed and put into the foreground. The moments when your app is "foregrounded" iOS will use a screenshot it makes automatically when backgrounding your app as launch image.
If you see Default.png even when you multitask between your App and some other App there is something wrong. Maybe you opted out on the multitasking thing with the UIApplicationExitsOnSuspend key in your plist or your App is crashing when going to the background/using too much memory to be backgrounded.
If you debug your App in XCode it should give you some hints in the console about memory warnings and it's easy to see if your App is killed.
On
Your app may have been terminated while it was in the background and is being started from the beginning. That would show the default screen again.
On
Default.png is also visible in scenario when your app is waiting for a response and you enter back ground, in that case your delegates will also not get called, after you receive response the delegates are called and the default.png is removed.
I observed that whenever application is resumed from background, iOS 5.0 simulator showed the default image or launch image, whereas iOS 4.3 simulator showed the screenshot of the application, when it was entering background.