GCD简单实用

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0),^{    

  for (inti =0; i < 2; ++i){

NSLog(@"1------%@",[NSThread currentThread]);

}  

// 回到主线程

    dispatch_async(dispatch_get_main_queue(), ^{     

  NSLog(@"2-------%@",[NSThread currentThread]);

});

});

你可能感兴趣的:(GCD简单实用)