CGContextSaveGState: invalid context 0x0 (Xcode 7 GM) CGContextSaveGState: invalid context 0x0 (Xcode 7 GM) xcode xcode

CGContextSaveGState: invalid context 0x0 (Xcode 7 GM)


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


I'm drawing using UIBezierPath

Removing path.fill() removed the warning.


I have found another cause for this error today.

When I wrote some drawing code in my View Controller class, these errors appeared. I realized that I have to create a UIView subclass and do the drawing steps in the override drawRect function. When I moved the drawing code there, all the errors disappeared.