title: iphone MPMoviePlayerViewController CGContext Errors
body: <p>I am writing an app for the iPhone that will play some movies utilizing <code>MPMoviePlayerViewController</code>.  So far I have gotten it to play movies, however it is throwing some errors in the debugger that all start with <code>CGContext</code>.  I have wracked my brain in trying to fix it.  Here are the details of my code:</p>
  
  <p>.h file:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;MediaPlayer/MediaPlayer.h&gt;
  @interface MovieViewController : UIViewController {
      MPMoviePlayerViewController *playerController;
  }
  
  -(IBAction) playMovie:(id)sender;
  </code></pre>
  
  <p>.m file:</p>
  
  <pre><code>@interface MovieViewController ()
  @end
  @implementation
  
  -(IBAction)playMovie:(id)sender {
  NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle]
                                       pathForResource:@"moviename" ofType:@"mp4"]];
  playerController =  [[MPMoviePlayerViewController alloc]
                       initWithContentURL:url];
  [self presentMoviePlayerViewControllerAnimated:playerController];
  playerController.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
  [playerController.moviePlayer play];
  playerController = nil; 
  }
  </code></pre>
  
  <p>When I run the program the movie will play, however when the code executes the line: <code>playerController =  [[MPMoviePlayerViewController alloc] initWithContentURL:url];</code> the following errors occur:</p>
  
  <pre><code>&lt;Error&gt;: CGContextSaveGState: invalid context 0x0
  &lt;Error&gt;: CGContextClipToRect: invalid context 0x0
  &lt;Error&gt;: CGContextTranslateCTM: invalid context 0x0
  &lt;Error&gt;: CGContextDrawShading: invalid context 0x0
  &lt;Error&gt;: CGContextRestoreGState: invalid context 0x0
  </code></pre>
  
  <p>I do know that <code>invalid context 0x0</code> means that those specific variables do not have a value, but I have no idea how to remedy this.  Any help would be greatly appreciated.</p>