Skip to content

Instantly share code, notes, and snippets.

@Pablo-Merino
Created June 4, 2011 14:43
Show Gist options
  • Save Pablo-Merino/1007946 to your computer and use it in GitHub Desktop.
Save Pablo-Merino/1007946 to your computer and use it in GitHub Desktop.
multi thread using gcd
dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
//PUT HERE THE CODE YOU WANT TO RUN IN ANOTHER THREAD
}
dispatch_async( dispatch_get_main_queue(), ^{
//PUT HERE THE BACKGROUND THREAD RESULTS FOR SHOWING THEM ON MAIN APP
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment