应用程序条件:shouldRestoreApplicationState:要调用的函数 [英] Condition for application:shouldRestoreApplicationState: function to be invoked
问题描述
我对IOS应用程序开发有点新。我使用cordova 2.1.0。我有一个基本的问题。何时应该应用程序:shouldSaveApplicationState:
函数被调用以保存应用程序状态?类似地,当应该 application:shouldRestoreApplicationState:
被调用以恢复状态/数据?
I am a bit new to IOS app development. I am using cordova 2.1.0. I have a kind of basic question. When should application:shouldSaveApplicationState:
function be called for saving Application state? And similarly, when should application:shouldRestoreApplicationState:
be called for restoring state/data?
推荐答案
您不要调用 application:shouldSaveApplicationState:
方法。
当您的应用程序即将关闭时,系统将调用这些方法,以便您可以保存应用程序的状态。
You don't call the application:shouldSaveApplicationState:
methods the system does.
When your app is about to be closed the system will call these method, so you can save the state of you application.
然后,当您的应用程式再次启动时,系统会呼叫 应用程序:shouldRestoreApplicationState:
恢复您的应用状态。
Then when your apps gest started again the system will call the application:shouldRestoreApplicationState:
to restore you apps state.
有例外,如果用户杀死了您的应用,那么状态也是删除。
There is on exception, if the user kills your app then the state is delete as well.
这篇关于应用程序条件:shouldRestoreApplicationState:要调用的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!