代码改变世界
2013-04-02 16:34
三戒1993
阅读(89)
评论()
编辑
收藏
举报
-
- (void)applicationDidEnterBackground:(UIApplication *)application {
-
-
UIDevice * device = [UIDevice currentDevice];
-
BOOL backgroundSupported = NO;
-
if ([device respondsToSelector:@selector(isMultitaskingSupported)]) {
-
backgroundSupported = device.multitaskingSupported;
-
}
-
-
__block UIBackgroundTaskIdentifier backgroundTask;
-
-
if (backgroundSupported) {
-
backgroundTask = [application beginBackgroundTaskWithExpirationHandler:^{
-
[application endBackgroundTask:backgroundTask];
-
backgroundTask = UIBackgroundTaskInvalid;
-
}];
-
}
-
-
-
}