I have this block of code here which I use to load an image on a dispatch queue:
dispatch_async(dispatch_get_global_queue(0, 0), ^
{
CGImageRef x = self.asset.defaultRepresentation.fullScreenImage;
dispatch_async(dispatch_get_main_queue(), ^
{
[[self imageView] setImage: [UIImage imageWithCGImage: x]];
});
});
The code seems to work a couple of times until eventually I get a bad access at this line [[self imageView] setImage: [UIImage imageWithCGImage: x]];. Anyone know what could be causing this?
Use
and
after you set that