title: convert NSData to mp4 file
body: <p>I use NSURLConnection to download remote mp4 file and write data to app directory, then play them.</p>
  
  <p>If I convert the NSData in this delegate method, everything is ok </p>
  
  <pre><code>    - (void)connectionDidFinishLoading:(NSURLConnection *)connection
  {
        [responseData writeToFile:path 
                 atomically:YES];
  }
  </code></pre>
  
  <p>But if I want to convert NSData in below delegate method, for example I just want the first half of Mp4, then something wrong, the Mp4 file  cannot play</p>
  
  <pre><code>- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 
  {
        [responseData writeToFile:path 
                 atomically:YES];
  }
  </code></pre>
  
  <p>Why?
  Thanks.</p>