'invalid context 0x0' after Migration to iOS 9

随声附和 提交于 2019-12-03 11:01:53

问题


I've migrated the app to iOS 9, and it works as usually, but there three log messages:

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

Maybe helps that the next message from Crashlytics is:

[Crashlytics:Crash] Warning: iOS 9 workaround for binary image loading issue in place.

Does anybody know how to fix it?


回答1:


This happens when there is a definition of UIViewControllerBasedStatusBarAppearance with false in info.plist.

If you don't need this you can set the key <key>UIViewControllerBasedStatusBarAppearance</key> to true in the file manually or change View controller-based status bar appearance option from Info to YES.

Also, I saw some posts that state there is no problem with this. As far as I know there's no way to set UIViewControllerBasedStatusBarAppearance from code, so I guess we'll have to wait until Apple will fix this issue. You can find more here.

Later Edit: It seems that iOS 9.1 solves this encountered errors. From last stable Xcode, running on iOS 9.1 result in no errors, while 9.0 still has the problems above.




回答2:


Apple has stated you can safely ignore these messages ': CGContextSaveGState: invalid context 0x0. "

Check the various Apple dev forums or support areas.



来源:https://stackoverflow.com/questions/32540095/invalid-context-0x0-after-migration-to-ios-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!