我已经创建了一个这样的队列
dispatch_queue_t myBackgroundQueue;
myBackgroundQueue = dispatch_queue_create("com.google.task", NULL);
dispatch_async(myBackgroundQueue, ^(void) {
});
这将在按钮单击时调用,我想知道当前的后台运行队列。谢谢
Best Answer-推荐答案 strong>
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
BOOL ok = // some result
// do some long running processing here
// Check that there was not a nil handler passed.
if( completionHandler )
{
// This assumes ARC. If no ARC, copy and autorelease the Block.
[completionHandler performSelectorselector(rmaddy_callBlockWithBOOL
onThreadrigThread
withObject(ok) // or [NSNumber numberWithBoolk]
waitUntilDone:NO];
}
});
});
关于iOS 如何获取后台调度队列完成状态,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/38848550/
|