Skip to content

Instantly share code, notes, and snippets.

View odrobnik's full-sized avatar

Oliver Drobnik odrobnik

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