- (void)applicationDidEnterBackground:(UIApplication *)application {



__block UIBackgroundTaskIdentifier bgTask;



bgTask
= [application beginBackgroundTaskWithExpirationHandler:^{



dispatch_async(dispatch_get_main_queue(),
^{



if (bgTask != UIBackgroundTaskInvalid)



{

bgTask
= UIBackgroundTaskInvalid;

}

});

}];



dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,
0), ^{



dispatch_async(dispatch_get_main_queue(),
^{

NSLog(
@"555555");



});



});

}

相关文章:

  • 2022-12-23
  • 2021-10-08
  • 2021-05-22
  • 2022-02-07
  • 2021-10-23
  • 2021-07-31
  • 2021-10-02
  • 2022-12-23
猜你喜欢
  • 2021-07-09
  • 2022-01-09
  • 2021-07-25
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案