iphone - Bug Loading Photo in Dispatch Queue -


i have block of code here use load image on 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 work couple of times until bad access @ line [[self imageview] setimage: [uiimage imagewithcgimage: x]];. know causing this?

use

cgimageref x = cgimagecreatecopy(self.asset.defaultrepresentation.fullscreenimage); 

and

cgimagerelease(x)  

after set that


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -

delphi - How to convert bitmaps to video? -