3
我得到在UIImagePNGRepresentation()處出現EXC_BAD_ACCESS錯誤,當Guard Malloc啓用且禁用時,我在轉換圖像時沒有收到任何錯誤。我已經通過谷歌解決方案,但我沒有找到任何工作解決方案。下面是代碼。當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插件代碼的一部分,任何建議都非常有幫助。 謝謝。
嘗試將擴展名添加到圖像名稱 –