1.默认为主线程,dispatch_get_main_queue()修改后如下
- //子线程延迟执行
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
- //需要执行的操作
- });
赞
踩
1.默认为主线程,dispatch_get_main_queue()修改后如下
- //子线程延迟执行
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
- //需要执行的操作
- });
转载于:https://my.oschina.net/u/2365397/blog/1630461
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。