Created
January 29, 2013 09:42
-
-
Save rpitting/4663066 to your computer and use it in GitHub Desktop.
Loading an image in den background queue, and assigning it to an image view in the main queue. Is this a good pattern?
This file contains 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
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ | |
UIImage* image = [UIImage imageWithContentsOfFile:...]; | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
self.targetImageView.image = image; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment