【问题标题】:EXC_BAD_ACCESS error in UIImagePNGRepresentation when Guard Malloc enabled启用 Guard Malloc 时 UIImagePNGRepresentation 中的 EXC_BAD_ACCESS 错误
【发布时间】:2013-03-24 18:01:55
【问题描述】:

当启用 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 插件代码的一部分,任何建议都非常有帮助。 谢谢。

【问题讨论】:

  • 尝试将扩展名添加到图像名称

标签: iphone ios malloc exc-bad-access uiimagepngrepresentation


【解决方案1】:

信息不足。但我可以给你一个提示,一些委托或财产被取消分配。将其定义为强

如果你能给你堆栈跟踪,它会更有帮助。

祝你好运

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-07-18
    • 2018-05-21
    • 2013-01-13
    • 2011-03-20
    • 2011-01-14
    • 1970-01-01
    • 1970-01-01
    • 2023-03-15
    相关资源
    最近更新 更多