开发者

Problem when exiting and trying to go back to the application [closed]

This question is unlikely to help any开发者_StackOverflow future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 10 years ago.

Pressing the exit button on the iPhone take me out of my application, if i tried to go back, i found my self on the latest screen, however, i want that i see the first screen(splash screen) each time i click my application icon.


This happens because your application is prepared to be running in background. For that reason, when you press the "home button", iOS is taking a screen shot of your current application state, so that when you wake up, it will be in the same state as before exiting. To avoid that and make your application star always fresh from the beginning, edit your plist file and set Application does not run in background key to YES


Set the UIApplicationExitsOnSuspend in your info.plist file to exit the application. And when relaunched you can start afresh. If you want to save the previous state then you do so in applicationDidEnterBackground in your app delegate. When you relaunch you can use the variables to set the state of the application before it exited.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜