4

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.

Paras Joshi
  • 20,427
  • 11
  • 57
  • 70
Theja
  • 744
  • 1
  • 7
  • 24

1 Answers1

0

Information in not sufficient. But I can give you a hint that some delegate or property is de-allocated. Define it as a strong

If you can give you the stack trace it will be more helpful.

Good Luck

Chamath Jeevan
  • 5,072
  • 1
  • 24
  • 27