Tekkaman

导航

 

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.

  

posted on 2014-05-21 15:30  Tekkaman  阅读(252)  评论(0编辑  收藏  举报