Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
552 views
in Technique[技术] by (71.8m points)

ios9 - CGContextSaveGState: invalid context 0x0 (Xcode 7 GM)

I have this problem after I compiled my code with Xcode 7 GM.

According to Apple this is a bug, but it still seems to be an issue. Everything works fine, but is it possible to get rid of these errors?

: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

enter image description here

Someone in other forums said something about status bar, but I don't have any success to eliminate the message. This is not a huge issue, but it's a useless "error". I'm using Interface Builder.

Updated: I used Objective-C if you use Swift, maybe this is the question you're looking for

question from:https://stackoverflow.com/questions/32490837/cgcontextsavegstate-invalid-context-0x0-xcode-7-gm

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This also happens for me on 7 GM, but removing UIViewControllerBasedStatusBarAppearance from Info.plist fixed it for me, as said here.

Update: Warning seems to be gone with iOS 9.2


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...