gpt4 book ai didi

UIImage的ressizedImageWithCapInsets在iOS 7下带来多个CoreGraphics "invalid context 0x0"错误

转载 作者:行者123 更新时间:2023-12-02 12:11:44 26 4
gpt4 key购买 nike

我刚刚注意到 iOS 7 下 ressizedImageWithCapInsets 的这个问题。突然,我收到此错误日志,但我的应用程序没有崩溃:

Oct 28 14:35:15 <Error>: CGContextSaveGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context  and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextSetBlendMode: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextSetAlpha: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextTranslateCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextScaleCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextGetCTM: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextSaveGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextClipToRect: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextDrawTiledImage: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
Oct 28 14:35:15 <Error>: CGContextRestoreGState: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

这是产生错误的代码:

[_registerButton setBackgroundImage:[[UIImage imageNamed:@"image.png"] resizableImageWithCapInsets:(UIEdgeInsets){15, 15, 15, 15}]forState:UIControlStateNormal];

如果我注释上面的行,错误就会消失。其他人遇到过这个错误吗?

最佳答案

发现问题了。 “image.png”文件高 30 像素,因此顶部和底部的 edgeInsets 均为 15,垂直方向上没有空白空间。它在视觉上工作正常,但我收到了这些错误。我希望这对其他人有用。

关于UIImage的ressizedImageWithCapInsets在iOS 7下带来多个CoreGraphics "invalid context 0x0"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19636303/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com