Glimpse
Glimpse copied to clipboard
Terminated due to memory issue
Whenever I call stop()
method, the app crashes with the debugger message: Terminated due to memory issue
try the change code
- (UIImage *)imageFromView:(UIView *)view
{
UIGraphicsBeginImageContextWithOptions(view.frame.size , YES , 0 );
// if ([view respondsToSelector:@selector(drawViewHierarchyInRect:afterScreenUpdates:)]) {
// [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];
// } else {
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
// }
UIImage *rasterizedView = UIGraphicsGetImageFromCurrentImageContext();
//compress image
NSData* data = UIImageJPEGRepresentation(rasterizedView, 0.5);
rasterizedView = [UIImage imageWithData:data];
UIGraphicsEndImageContext();
return rasterizedView;
}