func applicationDidEnterBackground(application: UIApplication)
{
var identifier:UIBackgroundTaskIdentifier = application.beginBackgroundTaskWithExpirationHandler({ () -> Void in
application.endBackgroundTask(identifier)
})
}
oc
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// 开启后台任务
UIBackgroundTaskIdentifier identifier = [application beginBackgroundTaskWithExpirationHandler:^{
[application endBackgroundTask:identifier];
}];
}
UIBackgroundTaskIdentifier
最新推荐文章于 2023-08-02 17:15:59 发布