IOS Default.png show every time my application comes to the fore from the background

I am new to iOS development.

I install the Default.png file and it is displayed every time the application enters the foreground from the background, but I just want Default.png to be displayed once when the application starts.

+4
source share
7 answers

I noticed that whenever the application resumes from the background, the iOS 5.0 sim showed a default image or a launch image, while the iOS 4.3 sim showed a screenshot of the app when it entered the background.

+4
source

For those who are looking for an answer, it may happen that your application does not complete the task that you configured when it enters the background. It will complete it and resume, or if you wait long enough in the background, the task will be completed and the application will come to the fore as expected.

+3
source

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 mode, <false/>

And here is the list of keys for UIKit on the Apple website , which includes the one I just referred to.

+2
source

Default.png is used only when your application is launched, and not when your application is resumed and placed in the foreground. The moments when your application is “in the foreground”, iOS will use the screenshot that it automatically takes when creating your application as a launch image.

If you see Default.png, even if you are using multitasking between your application and another application, something is wrong. You may have abandoned multitasking with the UIApplicationExitsOnSuspend key in your plist or your application may crash to the background / use too much memory for background recording.

If you are debugging an application in Xcode, it should give you some tips in the console about memory alerts and it is easy to see if your application is killed.

+2
source

Default.png is also displayed in the script when the application is waiting for a response, and you come back, in this case your delegates will not be called either, after you get the answer, the delegates will be called, and default.png will be deleted.

+1
source

Kelvin: I also have this problem, now I have solved it. The reason is because you are doing too much in applicationDidEnterBackground, try to shrink.

0
source

Your application may have been terminated when it was in the background and started from the very beginning. This will display the default screen again.

-1
source

Source: https://habr.com/ru/post/1383293/


All Articles