假设我正在异步调度中运行一些代码。..有没有办法在它完成之前终止它创建的线程?就像用户点击取消一样
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
//start doing something here.. break bofore it finishes?
dispatch_async(dispatch_get_main_queue(), ^{
//main thread stuff..
});
});