这段代码一定有问题:
+ (UIImage*)captureView:(UIView *)theView {
UIGraphicsBeginImageContext(theView.frame.size);
[theView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
当我使用它时,Xcode 会抛出这个错误消息:
malloc:* 对象 0x103f000 的错误:未分配被释放的指针 *在 malloc_error_break 中设置断点以进行调试
我在那里看不到任何内存管理错误。还有其他人吗?