Created
January 10, 2012 18:39
-
-
Save tmdvs/1590431 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSArray *myMainThreadShit = nil; | |
dispatch_async( dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0 ), ^{ | |
// do massive intensive shit | |
NSArray *myShit = [MyModel getMyShit]; | |
dispatch_async( dispatch_get_main_queue(), ^{ | |
// this is on main thread | |
myMainThreadShit = [myShit copy]; | |
}); | |
}); | |
return myMainThreadShit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment