I do not think the memory issue is causing your problem. You must take a screenshot using void UIGraphicsBeginImageContextWithOptions(CGSize size,BOOL opaque,CGFloat scale); . The last parameter set to 0.0 will take care of the problem of the retina / non-retina.
"The scale factor applied to the bitmap. If you specify a value of 0.0, the scale factor will be set to the scale factor of the deviceโs main screen." From the documentation .
UIGraphicsBeginImageContextWithOptions(webview.bounds.size, YES, 0.0); [webview.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();
EDIT: you say your application is still crashing.
Is it possible that you forgot to add the QuartzCore framework .
You also need to import the QuartzCore header :
#import <QuartzCore/QuartzCore.h>
from Technical Q & A QA1703 (Screen capture in UIKit applications)
source share