我将图像的 NSData 转换为 CGImage 如下,但我在那里遇到内存泄漏,但有人告诉我如何转换它而不发生泄漏:
CFDataRef imgData;
CGDataProviderRef imgDataProvider;
CGImageRef image1;
imgData = (CFDataRef)[array objectAtIndex:i];
imgDataProvider = CGDataProviderCreateWithCFData (imgData);
image1 = CGImageCreateWithPNGDataProvider(imgDataProvider, NULL, true, kCGRenderingIntentDefault);