当启用 Guard Malloc 时,我在 UIImagePNGRepresentation() 处收到 EXC_BAD_ACCESS 错误,当我禁用时,我在转换图像时没有收到任何错误。我已经通过谷歌寻求解决方案,但我没有找到任何可行的解决方案。下面是代码。
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
这是 phonegap 插件代码的一部分,任何建议都非常有用。 谢谢。
最佳答案
信息不充分。但我可以给你一个提示,一些委托(delegate)或属性(property)被取消分配。定义为强
如果你能给你堆栈跟踪,它会更有帮助。
祝你好运
关于iphone - 启用 Guard Malloc 时 UIImagePNGRepresentation 中的 EXC_BAD_ACCESS 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15781119/