iOS 4中禁止程序退出后保留在后台的方法
2010-09-15 23:56:00 来源:WEB开发网只需要在plist中加入UIApplicationExitsOnSuspend。
Opting Out of Background Execution
If you do not want your application to remain in the background when it is quit, you can explicitly opt out of the background execution model by adding the UIApplicationExitsOnSuspend key to your application’s Info.plist file and setting its value to YES. When an application opts out, it cycles between the not running, inactive, and active states and never enters the background or suspended states. When the user taps the Home button to quit the application, the applicationWillTerminate: method of the application delegate is called and the application has approximately five seconds to clean up and exit before it is terminated and moved back to the not running state.
Opting out of background execution may be preferable for certain types of applications. Specifically, if coding for the background may require adding significant complexity to your application, terminating the application may be a simpler solution. Also, if your application consumes a large amount of memory, the system might need to terminate your application quickly anyway to make room for other applications. Thus, opting to terminate, instead of switch to the background, might yield the same results and save you development time and effort.
Note: Explicitly opting out of background execution is necessary only if your application is linked against iPhone SDK 4 and later. Applications linked against earlier versions of the SDK do not support background execution as a rule and therefore do not need to opt out explicitly.
- ››iOS Safari支持浏览器内方向感应
- ››ios实现条形码扫描功能
- ››iOS开发知识:Core data操作含有初始数据的sqlite...
- ››iOS iPhone官方参考资料明细
- ››iOS开发基础:Modal View Controller的不同呈现方...
- ››iOS如何处理设备方向变化
- ››iOS开发基础之@property关键字
- ››iOS4下实现UIView动画结束后调用事件的新方法
- ››iOS开发代码:从文本文件中读取内容到字符串里
- ››iOS开发基础-UITableView
- ››iOS 开发者应该知道的 ARM 结构
- ››iOS4越狱limera1n Windows版下载
更多精彩
赞助商链接