- (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");



});



});

}

posted on 2011-05-23 14:19  一个人的天空@  阅读(492)  评论(0编辑  收藏  举报