dispatch_get_current_queue


Gerriet M. Denkmann
 

macOS 13.6

For debugging purposes I want to test that certain methods do run in the correct queue.

So:
dispatch_queue_t queue = dispatch_get_current_queue();
const char *label = dispatch_queue_get_label(queue);
NSString *qLabel = [NSString stringWithUTF8String: label];

if ( ![ qLabel isEqualToString: supposedLabel ] ) … // error

But Xcode tells me that dispatch_get_current_queue is deprecated.

What to do instead?

Gerriet.

Join cocoa@apple-dev.groups.io to automatically receive all group messages.