更新:我正在使用带有Swift 2.0的XCode 7 Beta
当我尝试在iPhone上运行我的应用程序时,我会收到以下3个错误:
<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.
当我启用CG_CONTEXT_SHOW_BACKTRACE变量时,我会得到这个:
Backtrace:
<<redacted>+40>
<<redacted>+432>
<<redacted>+144>
<<redacted>+172>
<<redacted>+332>
<<redacted>+112>
<<redacted>+820>
<<redacted>+688>
<<redacted>+356>
<<redacted>+80>
<<redacted>+808>
<<redacted>+344>
<<redacted>+420>
<<redacted>+104>
<<redacted>+284>
<<redacted>+556>
<<redacted>+504>
<<redacted>+1792>
<<redacted>+220>
<<redacted>+284>
<<redacted>+920>
<<redacted>+168>
<<redacted>+184>
<<redacted>+56>
<<redacted>+24>
<<redacted>+540>
<<redacted>+724>
<CFRunLoopRunSpecific+384>
<<redacted>+460>
<UIApplicationMain+204>
<main+164>
我不确定如何解释这个问题,我的代码中没有使用任何CoreGraphics内容,并且其他类似的问题的答案对我没有用。我知道在没有代码的情况下进行调试可能很困难,但是我无法弄清楚与此相关的代码,因此如果有人有想法,我可以发布更多代码。