Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 15 iOS17 Crash #354

Open
MrChen88088 opened this issue Jan 5, 2024 · 3 comments
Open

Xcode 15 iOS17 Crash #354

MrChen88088 opened this issue Jan 5, 2024 · 3 comments

Comments

@MrChen88088
Copy link

*** 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 方法被弃用,麻烦作者可以更新一下吗?

@ngng1024GH
Copy link

*** 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;

@ngng1024GH
Copy link

这一篇更详细一点,可能需要自己去做修改了
https://blog.csdn.net/weixin_42050662/article/details/134524136

@frankkly
Copy link

*** 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;

感谢,有效,作者快快更新~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants