Skip to content

Instantly share code, notes, and snippets.

Avatar

Oliver Drobnik odrobnik

View GitHub Profile
@followben
followben / qt_dispatch_sync_to_main_queue.m
Created May 30, 2012
qt_dispatch_sync_to_main_queue - performSelector on main thread for GCD
View qt_dispatch_sync_to_main_queue.m
void qt_dispatch_sync_to_main_queue(dispatch_block_t aBlock) {
if ([NSThread isMainThread]) {
aBlock();
} else {
dispatch_sync(dispatch_get_main_queue(), aBlock);
}
}