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

问题描述

我已经阅读了很多关于这个可怕问题的搜索结果,不幸的是,每个人似乎都专注于特定的函数调用。

I've read as many search results I could find on this dreaded problem, unfortunatelly, each one seems to focus on a specific function call.

我的问题是我从多个函数中得到了相同的错误,我猜测它是从我使用的函数中调用的。

My problem is that I get the same error from multiple functions, which I am guessing are being called back from functions that I use.

更糟糕的是,实际的代码是在在另一个项目中导入的自定义私有框架,因此调试并不那么简单?

To make matters worse, the actual code is within a custom private framework which is being imported in another project, and as such, debugging isn't as simple?

有人能指出我正确的方向吗?我有一种感觉我错误地调用某些方法或者上下文不好,但xcode的输出在这一点上并没有很大帮助。

Can anyone point me to the right direction? I have a feeling I'm calling certain methods wrongly or with bad context, but the output from xcode is not very helpful at this point.

: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:无效的上下文0x0。这是一个严重的错误。
此应用程序或其使用的库使用无效的上下文
,从而导致系统整体降低
的稳定性和可靠性。此通知是礼貌的:请修复此
问题。它将在即将到来的更新中成为致命错误。

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.

:CGContextSetFlatness:无效的上下文0x0。这是一个严重的
错误。此应用程序或它使用的库正在使用无效的
上下文,从而导致
系统稳定性和可靠性的整体降级。此通知是礼貌的:请
修复此问题。它将在即将到来的更新中成为致命错误。

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

:CGContextAddPath:无效的上下文0x0。这是一个严重的
错误。此应用程序或它使用的库正在使用无效的
上下文,从而导致
系统稳定性和可靠性的整体降级。此通知是礼貌的:请
修复此问题。它将在即将到来的更新中成为致命错误。

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

:CGContextDrawPath:无效的上下文0x0。这是一个严重的
错误。此应用程序或它使用的库正在使用无效的
上下文,从而导致
系统稳定性和可靠性的整体降级。此通知是礼貌的:请
修复此问题。它将在即将到来的更新中成为致命错误。

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

:CGContextRestoreGState:无效的上下文0x0。这是
严重错误。此应用程序或它使用的库使用
无效上下文,从而导致系统稳定性和可靠性整体下降
。此通知是礼貌的:请
修复此问题。它将在即将到来的更新中成为致命错误。

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

:CGContextGetBlendMode:无效的上下文0x0。这是一个严重的
错误。此应用程序或它使用的库正在使用无效的
上下文,从而导致
系统稳定性和可靠性的整体降级。此通知是礼貌的:请
修复此问题。在即将到来的更新中它将成为一个致命的错误。

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

当呈现自定义视图或其中一个继承时,可能会出现这些错误类。此时它们会多次生成,直到键盘不提供任何输入。触摸事件仍然已注册,但系统速度变慢,最终可能导致未分配的对象错误。

Those errors may occur when a custom view is presented, or one of its inherited classes. At which point they spawn multiple times, until the keyboard won't provide any input. Touch events are still registered, but system slows down, and eventually may lead to unallocated object errors.

编辑#1:我确实可以访问对于正在导入的框架,但我没有看到引起问题的类中有任何奇怪的东西。

EDIT #1: I do have access to the framework being imported, but I do not see anything weird in the classes which causing the issue.

编辑#2:我刚收到iOS 7.1已发布给开发人员的电子邮件。我很想知道这是否会消失,或者变得更糟,或者可以解决。

EDIT #2: I just received an email that iOS 7.1 has been released for developers. I'm curious to see if this goes away, or become worse, or can be solved.

推荐答案

其他人会要求你发布您访问核心图形上下文的代码,但我怀疑这是问题所在。这些无效的上下文0x0错误消息很常见,很容易在iOS 7中重现。事实上,我可以使用零代码的故事板重现错误。我将UITextField拖到IB的画布上,运行应用程序,然后在文本字段内双击。

Others will ask you to post the code where you access a core graphics context, but I doubt that's the issue. These invalid context 0x0 error messages are common and easy to reproduce in iOS 7. In fact, I can reproduce the error using storyboard with zero code. I drag a UITextField onto the canvas in IB, run the app, and double tap inside the text field.

在很多情况下,我很难认真对待无效的上下文0x0错误消息。我不知道你的情况是否值得更加关注(我同意Rob Napier的说法值得调查,特别是如果你明确使用图形上下文的话)。

In many situations, it's hard for me to take the invalid context 0x0 error messages seriously. I don't know if your situation warrants greater concern (I agree with Rob Napier that it's worth investigating, especially if you are explicitly using a graphics context).

在我的自己的项目,我希望其中许多错误在某一天神奇地消失(但那一天没有7.0.3)。

In my own projects, I'm hoping that many of these errors magically disappear some day (but that day did not come with 7.0.3).

更新:安装Xcode 5.1并定位iOS 7.1后,我无法再通过在空文本字段内双击来重现错误。

Update: After installing Xcode 5.1 and targeting iOS 7.1, I can no longer reproduce the error by double tapping inside an empty text field.

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

07-30 19:38