GCD-Grand Central Dispatch
经常要用的,总结分类一下。 //获得队列 DISPATCH_QUEUE_PRIORTY 优先级 dispatch_queue_t Queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0); dispatch_queue_t MainQueue = dispatch_get_main_queue(); //自定义Queue 第二参数默认串行(FIFO) DISPATCH_QUEUE_CONCURRENT(可选,并发) dispatch_queue_t SelfQueue = dispatch_queue_create("COM.M1989.Queue", NULL); //dispatch_async dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0), ^{ //Do Some? }); dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0), ^{ //耗时操作 dispatch_async(dispatch_get_main_queue(), ^{ //更新界面 }); }); //dispatch