Xcode 15 iOS17 Crash
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={0, 0}, scale=3.000000, bitmapInfo=0x2006. Use UIGraphicsImageRenderer to avoid this assert.'
_UIGraphicsBeginImageContextWithOptions 方法被弃用,麻烦作者可以更新一下吗?
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={0, 0}, scale=3.000000, bitmapInfo=0x2006. Use UIGraphicsImageRenderer to avoid this assert.'
_UIGraphicsBeginImageContextWithOptions 方法被弃用,麻烦作者可以更新一下吗?
可以试一下这个方法,参考这篇: https://www.jianshu.com/p/aeb0b9129fcd UIGraphicsImageRenderer *re = [[UIGraphicsImageRenderer alloc]initWithSize:view.bounds.size]; UIImage *image = [re imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) {
}]; return image;
这一篇更详细一点,可能需要自己去做修改了 https://blog.csdn.net/weixin_42050662/article/details/134524136
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={0, 0}, scale=3.000000, bitmapInfo=0x2006. Use UIGraphicsImageRenderer to avoid this assert.' _UIGraphicsBeginImageContextWithOptions 方法被弃用,麻烦作者可以更新一下吗?
可以试一下这个方法,参考这篇: https://www.jianshu.com/p/aeb0b9129fcd UIGraphicsImageRenderer *re = [[UIGraphicsImageRenderer alloc]initWithSize:view.bounds.size]; UIImage *image = [re imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) {
}]; return image;
感谢,有效,作者快快更新~