PS:我的应用可以在后台运行.
你有什么解决办法?谢谢.
解决方法 抱歉,您应该使用applicationWillTerminate:This method lets your app kNow that it is about to be terminated and
purged from memory entirely. You should use this method to perform any
final clean-up tasks for your app,such as freeing shared resources,
saving user data,and invalIDating timers. Your implementation of this
method has approximately five seconds to perform any tasks and return.
If the method does not return before time expires,the system may kill
the process altogether.For apps that do not support background execution or are linked
against iOS 3.x or earlIEr,this method is always called when the user
quits the app. For apps that support background execution, this method
is generally not called when the user quits the app because the app
simply moves to the background in that case. However,this method may
be called in situations where the app is running in the background
(not suspended) and the system needs to terminate it for some reason.
因此,如果您需要在用户手动终止应用程序时保存数据,请使用applicationDIDEnterBackground,如果您的应用程序支持后台模式,则调用它.
总结以上是内存溢出为你收集整理的当我的应用程序在ios中的后台终止时如何执行代码全部内容,希望文章能够帮你解决当我的应用程序在ios中的后台终止时如何执行代码所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)