GCD获取异步线程主线程

 异步线程

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

        

      dispatch_async(dispatch_get_main_queue(), ^{

          

      });

        

    });

延迟

 double delayInSeconds = 3;

    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));

    dispatch_after(popTime, dispatch_get_main_queue(), ^(void){

   

    });

posted @ 2016-08-03 12:04  YuFly  阅读(745)  评论(0编辑  收藏  举报