invalid context 0x0 under iOS 7.0 and system degra

2019-01-02 19:18发布

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?

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.

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

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

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.

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.

26条回答
路过你的时光
2楼-- · 2019-01-02 20:08

If you're curious what code is causing these logs, you can add a symbolic breakpoint on CGPostError.

查看更多
浅入江南
3楼-- · 2019-01-02 20:09

I had this problem with a simple UITextField (keyboard not showing up and many different invalid context error messages on the console). I just find a workaround by looking to another problem on SO: Cannot find executable for CFBundle CertUIFramework.axbundle

Just do:

click on iOS Simulator > Reset Content and Settings... and run again.

The problem shouldn't be there anymore

查看更多
登录 后发表回答