0
votes

if I start my app (ios 9 with Swift 2) in xcode 7, I get this warnings at beginning:

Oct 9 10:45:11 AppName[2866] : CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Oct 9 10:45:11 AppName[2866] : CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Oct 9 10:45:11 AppName[2866] : CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

What can I do to solve this warnings?

1
This is a bug in Xcode see here: forums.developer.apple.com/thread/13683Skywalker
okay, so i can ignore this and have to wait for an update?Ghost108

1 Answers

4
votes

It seems like that you are setting the corner radius(working with layers) of a view.

Solution 1:

Set environmental variable via menu: Product-> Scheme->Edit Scheme. In "Run" item, locate "Arguments" tab, you'll see "Environmental Variables" in the tab, Add CG_CONTEXT_SHOW_BACKTRACE and set its value to YES.

Solution 2:- If above solutions does not work for you, then remove the UIViewControllerBasedStatusBarAppearance from Info.plist.