iOS5的后台管理从iOS4的有什么不同? [英] ios5 background management different from ios4?

查看:205
本文介绍了iOS5的后台管理从iOS4的有什么不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要做一些URL请求时,我的应用程序被切换到后台

I need to make some url request when my application goes to background

我用模拟器开发,我刚才注意到,当我preSS电源按钮锁定屏幕的appDelegate方法

I'm developing with the simulator and I've just noticed that when I press the power button to lock the screen the appDelegate method

- (void)applicationDidEnterBackground:(UIApplication *)application

与iOS 5会自动调用,但这并不与iOS 4出现

with iOS 5 is automatically called, but this doesn't happen with iOS 4

是不是?有人可以尝试,如果在真实设备上有相同的结果?

is it right? can someone try if on real devices there's the same result?

是它可以检测电源按钮pressure和区分home键pressure行动?

is it possible to detect the power button pressure and differentiate the actions from the home button pressure?

感谢您!

推荐答案

是的,这是正确的。

参加苹果的WWDC 2011的视频

您可以使用 beginBackgroundTaskWithExpirationHandler:做你的要求。

You can use beginBackgroundTaskWithExpirationHandler: to do your requests.

这篇关于iOS5的后台管理从iOS4的有什么不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆