0

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?

Cœur
  • 32,421
  • 21
  • 173
  • 232
Ghost108
  • 3,277
  • 8
  • 37
  • 79
  • 2
    This is a bug in Xcode see here: https://forums.developer.apple.com/thread/13683 – Skywalker Oct 09 '15 at 08:53
  • okay, so i can ignore this and have to wait for an update? – Ghost108 Oct 09 '15 at 08:54
  • 1
    Possible duplicate of [How can I set CG\_CONTEXT\_SHOW\_BACKTRACE environmental variable?](http://stackoverflow.com/questions/31872650/how-can-i-set-cg-context-show-backtrace-environmental-variable) – Anbu.Karthik Oct 09 '15 at 09:04

1 Answers1

4

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.

pkc456
  • 7,998
  • 34
  • 45
  • 99
  • Solution 1 does not work. Solution 2 works fine -> no warnings, but now is the font color auf the status bar black and not white – Ghost108 Oct 09 '15 at 08:59
  • @Ghost108 You can check for how to set statusbar to light content http://stackoverflow.com/questions/32730211/how-we-can-set-the-light-content-style-of-status-bar-in-ios-9-for-whole-applicat – Ashish Kakkad Oct 09 '15 at 09:05