如何解决应用程序在后台运行-在应用程序运行时点按主页按钮
| 当我们点击iPhone上的主页按钮时,即应用程序在后台运行时,调用的方法序列是什么? 基本上,我想在我的应用程序进入后台之前进行服务器调用。我在applicationWillResignActive:
中编写服务器调用代码,但有时执行,有时不执行。
我需要一个解决方案。
解决方法
从应用程序委托文件本身:
- (void)applicationDidEnterBackground:(UIApplication *)application {
/*
Use this method to release shared resources,save user data,invalidate timers,and store enough application state information to restore your application to its current state in case it is terminated later.
If your application supports background execution,called instead of applicationWillTerminate: when the user quits.
Superclass implementation saves changes in the application\'s managed object context before the application terminates.
*/
[super applicationDidEnterBackground:application];
}
尝试使用此方法.....
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。