title: Why there is an invalid context error?
body: <p>Here is the code I use to draw:</p>
  
  <pre><code>- (void) drawSomething
  {
  
      CGContextRef context = UIGraphicsGetCurrentContext();
      CGContextSetRGBStrokeColor(context, 1, 0, 0, 1);
      CGContextSetLineWidth(context, 6.0);
  
      CGContextMoveToPoint(context, 100.0f, 100.0f);
      CGContextAddLineToPoint(context, 200.0f, 200.0f);
      CGContextStrokePath(context);
  
      NSLog(@"draw");
  
  }
  </code></pre>
  
  <p>But I got the error like this:</p>
  
  <pre><code>[Session started at 2010-04-03 17:51:07 +0800.]
  Sat Apr  3 17:51:09 MacBook.local MyApp[12869] &lt;Error&gt;: CGContextSetRGBStrokeColor: invalid context
  Sat Apr  3 17:51:09 MacBook.local MyApp[12869] &lt;Error&gt;: CGContextSetLineWidth: invalid context
  Sat Apr  3 17:51:09 MacBook.local MyApp[12869] &lt;Error&gt;: CGContextMoveToPoint: invalid context
  Sat Apr  3 17:51:09 MacBook.local MyApp[12869] &lt;Error&gt;: CGContextAddLineToPoint: invalid context
  Sat Apr  3 17:51:09 MacBook.local MyApp[12869] &lt;Error&gt;: CGContextDrawPath: invalid context
  </code></pre>
  
  <p>Why it prompt me to say that the context is invalided?</p>