本文介绍了CGContext 无效上下文 0x0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

: CGContextSetFillColorWithColor: 无效的上下文 0x0.这是一个严重的错误.此应用程序或其使用的库正在使用无效的上下文,从而导致整体退化系统的稳定性和可靠性.本通知是礼貌:请解决这个问题.这将在即将到来的更新中成为致命错误.

: CGContextSetStrokeColorWithColor: 无效的上下文 0x0.这是一个严重的错误.此应用程序或其使用的库正在使用一个无效的上下文,从而有助于整体系统稳定性和可靠性下降.该通知是一个礼貌:请解决这个问题.这将成为一个致命的错误即将更新.

: CGContextSetStrokeColorWithColor: 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.

和类似的错误重复:

  • CGContextSaveGState
  • CGContextSetFlatness
  • CGContextAddPath
  • CGContextDrawPath
  • CGContextRestoreGState
  • CGContextSaveGState
  • CGContextSetFlatness
  • CGContextAddPath
  • CGContextDrawPath
  • CGContextRestoreGState
  • CGContextSetFillColorWithColor
  • CGContextSetStrokeColorWithColor
  • CGContextSetFillColorWithColor
  • CGContextSetStrokeColorWithColor
  • CGContextGetBlendMode
  • CGContextSetBlendMode
  • 还有更多...

在我的应用程序中,我不使用任何 CGContext 的东西.我只有一个 UITextViewUIButtonUILabel.还没有添加多少代码.只需通过以下方式设置 UITextView 的内容:

In my App, I do not use any CGContext stuff. I just have a UITextView, UIButton and UILabel. Not much codes added yet. Just set the content of UITextView by:

[self.text_view setText:@"123"];

如何解决错误?

我使用的是 Xcode 5.0(版本 5A1413)、iOS 7 模拟器(64 位 Retina 4")、Mac OS X 10.8.5

I'm using Xcode 5.0 (build 5A1413), iOS 7 Simulator (64-bit Retina 4"), Mac OS X 10.8.5

推荐答案

试试这个:在 xcode 中向 CGPostError 添加符号断点.(添加符号断点,并给Symbol字段类型CGPostError)

Try this: In xcode add symbolic breakpoint to CGPostError. (Add symbolic breakpoint, and to Symbol field type CGPostError)

当发生错误时,调试器将停止代码执行,您可以检查方法调用堆栈和检查参数.

When error happen, debugger will stop code executions and you can check stack of methods calls and check parameters.

这篇关于CGContext 无效上下文 0x0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 12:31