dispatch_queue_t queue =
dispatch_get_global_queue(
DISPATCH_QUEUE_PRIORITY_DEFAULT,
0
);
dispatch_async
(queue, ^{
]];
[
_webView
loadRequest
:request];
NSLog(
@"
使用异步函数执行主队列中的任务
1--%@",[
NSThread
currentThread
]);
dispatch_async(
dispatch_get_main_queue
(), ^{
[
self.
view
addSubview:
_webView
];
NSLog(
@"
使用异步函数执行主队列中的任务
2--%@",[
NSThread
currentThread
]);
});
});