title: Video capture on an iPhone; captureOutput delegate never called
body: <p>Hey folks.  Trying to get started with iPhone video capture stuff, and having a terrible time getting it going.</p>
  
  <p>At the moment, working with an exact copy of the sample code from this Apple Developer Q&amp;A: <a href="http://developer.apple.com/library/ios/#qa/qa2010/qa1702.html" rel="nofollow" title="qa1702">qa1702</a>; not going to re-paste it here, since it's a relatively big blob of code.</p>
  
  <p>In any case, I copied and pasted that code into an otherwise-empty project, threw in a call to setupCaptureSession into a custom UIView, and figured I should be good to go:</p>
  
  <pre><code>- (void)awakeFromNib {
      NSLog(@"init");
      [self setupCaptureSession]; 
  }
  </code></pre>
  
  <p>Unfortunately, when I run the code, my delegate never seems to be called:</p>
  
  <pre><code>- (void)captureOutput:(AVCaptureOutput *)captureOutput 
  didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer 
         fromConnection:(AVCaptureConnection *)connection
  { 
      NSLog(@"New Image!");
  }
  </code></pre>
  
  <p>I'd expect to be seeing a flood of "New Image!" getting dumped to the log, but I'm getting absolutely nothing.  I <em>do</em> know that all the initialization code is being run (I threw a few NSLog statements here and there within setupCaptureSession, and they all print).</p>
  
  <p>So, I'd either A) like to figure out what I'm doing wrong or B) see some <em>very simple</em> capture code embedded into a UIView that actually works (the less code, the better).  Ideally, the sample code would use the setupCaptureSession code as described in the Apple developer site above.</p>
  
  <p>Note that this code is being tested on an iPhone 3GS running the newest version of iOS 4.</p>
  
  <p>Thanks in advance!</p>