1. 程式人生 > >iOS GCD子執行緒呼叫主執行緒重新整理

iOS GCD子執行緒呼叫主執行緒重新整理

__weak__typeof(self) weakself= self;

dispatch_async(dispatch_queue_create(0, 0), ^{

// 子執行緒執行任務(比如獲取較大資料)

dispatch_async(dispatch_get_main_queue(), ^{

// 通知主執行緒重新整理 神馬的

        });

    });