我从webview渲染图像。所以renderIncontext方法在for循环中调用超过50次。 20或30次后,我的应用程序崩溃,因为更多的内存消耗。renderInContext抛出崩溃
我用这个代码:
UIGraphicsBeginImageContext(CGSizeMake([w floatValue], [h floatValue]));
CGContextRef ctx = UIGraphicsGetCurrentContext();
[[UIColor blackColor] set];
CGContextFillRect(ctx, webview.frame);
[self.webview.layer renderInContext:ctx];
image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
次后20它得到坠毁。我需要它的解决方案。
为什么出现这种情况?有谁知道?
HI,你找到了一个解决方案,即时通讯也有同样的问题?如果是的话请共享解决方案 – Infaz