iphone - 启用 Guard Malloc 时 UIImagePNGRepresentation 中的 EXC_BAD_ACCESS 错误

标签 iphone ios malloc exc-bad-access uiimagepngrepresentation

当启用 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/

相关文章:

c - 如何找到malloc分配的字节数

c++ - 字符串数组 C++ 的段错误

iphone - 是否有类似 "Codea"的应用程序,但用于 MonoTouch?

iPhone - 暂停时应用程序退出

iphone - 如何在uiwebview上添加捏和缩放-iPhone

iphone - 更改 UINavigationController 过渡效果的正确方法是什么

ios - Xcode 4.5 : "does not have access to iOS 5.1 simulator"

ios - 委托(delegate)和数据源不与 UIPickerViewDelegate 一起工作

iphone - 从 C 到 Objective-C 的回调方法

C 帮助解释 calloc segfault