【Determining Whether Multitasking Is Available】
Apps must be prepared to handle situations where multitasking (and therefore background execution) is not available. Even if the device is running iOS 4 or later, the device may not support multitasking.
Apps必须处理无法后台运行的情况。即使设备在运行iOS4或以上版本,这台设备也可能不支持多任务 。
And multitasking is never available on devices running iOS 3 and earlier. If your app is capable of running on these earlier versions of iOS, it must be prepared to run without multitasking.
App后台运行无法跑在iOS3和早期版本里。如果你的app想要跑在低版本iOS上,必须处理好无法后台运行的情况。
If the presence or absence of multitasking changes the way your app behaves, check the multitaskingSupported property of the UIDevice class to determine whether multitasking is available before performing the relevant task.
在执行后台任务前,通过UIDevice的multitaskingSupported属性来判断是否支持多任务。
To do this, you must build your app against iOS SDK 4 or later and check to see if the property is available before accessing it, as shown in Listing 3-2. Checking the property allows your app to continue running on earlier versions of iOS that do not support multitasking.
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步