[英]GCD obtaining queue name/label
How can I get the current queue name?如何获取当前队列名称?
I mean queue label like com.example.myqueue
.我的意思是像
com.example.myqueue
这样的队列标签。
In the Xcode 4 debugger I can see just _block_invoke_1
.在 Xcode 4 调试器中,我只能看到
_block_invoke_1
。
In Objective-C you can log the label of the current queue with:在 Objective-C 中,您可以使用以下命令记录当前队列的标签:
NSLog(@"%s", dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL));
In Swift (2.0):在 Swift (2.0) 中:
print(String(UTF8String: dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL))!)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.