I am getting EXC_BAD_ACCESS error at UIImagePNGRepresentation() when Guard Malloc enabled and when I disable I am not getting any error while converting image. I have gone through google for solution but I am not find any working solution approach. below is the code.
UIImage *image, *newImage;
NSData *imageData = [NSData dataWithContentsOfFile:@"somepath"];
image = [UIImage imageWithData:imageData];
NSData* data = nil;
data = UIImagePNGRepresentation(image);
// write to temp directory and return URI
NSString* docsPath = [NSTemporaryDirectory ()stringByStandardizingPath];
// more code
this is a part of phonegap plugin code and any suggestions are really helpful. Thanks.