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
Post a Comment