title: CGContextSaveGState: invalid context 0x0 Error only on device
body: <p><strong>Update: I am using XCode 7 Beta with Swift 2.0</strong></p>
  
  <p>When I try to run my app on an iPhone I get these 3 errors:</p>
  
  <pre><code>&lt;Error&gt;: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
  &lt;Error&gt;: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
  &lt;Error&gt;: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
  </code></pre>
  
  <p>When I enable to CG_CONTEXT_SHOW_BACKTRACE variable I get this: </p>
  
  <pre><code>Backtrace:
        &lt;&lt;redacted&gt;+40&gt;
         &lt;&lt;redacted&gt;+432&gt;
          &lt;&lt;redacted&gt;+144&gt;
           &lt;&lt;redacted&gt;+172&gt;
            &lt;&lt;redacted&gt;+332&gt;
             &lt;&lt;redacted&gt;+112&gt;
              &lt;&lt;redacted&gt;+820&gt;
               &lt;&lt;redacted&gt;+688&gt;
                &lt;&lt;redacted&gt;+356&gt;
                 &lt;&lt;redacted&gt;+80&gt;
                  &lt;&lt;redacted&gt;+808&gt;
                   &lt;&lt;redacted&gt;+344&gt;
                    &lt;&lt;redacted&gt;+420&gt;
                     &lt;&lt;redacted&gt;+104&gt;
                      &lt;&lt;redacted&gt;+284&gt;
                       &lt;&lt;redacted&gt;+556&gt;
                        &lt;&lt;redacted&gt;+504&gt;
                         &lt;&lt;redacted&gt;+1792&gt;
                          &lt;&lt;redacted&gt;+220&gt;
                           &lt;&lt;redacted&gt;+284&gt;
                            &lt;&lt;redacted&gt;+920&gt;
                             &lt;&lt;redacted&gt;+168&gt;
                              &lt;&lt;redacted&gt;+184&gt;
                               &lt;&lt;redacted&gt;+56&gt;
                                &lt;&lt;redacted&gt;+24&gt;
                                 &lt;&lt;redacted&gt;+540&gt;
                                  &lt;&lt;redacted&gt;+724&gt;
                                   &lt;CFRunLoopRunSpecific+384&gt;
                                    &lt;&lt;redacted&gt;+460&gt;
                                     &lt;UIApplicationMain+204&gt;
                                      &lt;main+164&gt;
  </code></pre>
  
  <p>I'm not sure how to interpret this, I am not using any CoreGraphics content in my code, and the other similar questions had answers that did not work for me. I understand it can be difficult to help debug without code, but I can't figure out what code is related to this, so if anyone has an idea I can post more code.</p>