Thank. which worked great. For anyone reading this, my code. It works, but we warn you, I'm new to iOS and objective-C, so I caution emptor.
- (void)viewWillAppear:(BOOL) animated
{
NSURL *imageURL = [NSURL URLWithString:@"http://www.domain.com/image.jpg"];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
NSData *imageData = [NSData dataWithContentsOfURL:imageURL];
dispatch_async(dispatch_get_main_queue(), ^{
self.img.image = [UIImage imageWithData:imageData];
});
});
}
source
share