Something must be wrong with this code right here:
+ (UIImage*)captureView:(UIView *)theView {
UIGraphicsBeginImageContext(theView.frame.size);
[theView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
When I use that, Xcode throws me this error message:
malloc: * error for object 0x103f000: pointer being freed was not allocated * set a breakpoint in malloc_error_break to debug
I can't see any memory management errors there. Does anyone else?