title: How to start playing AVAudioPlayer while downloading?
body: <p>I have a mp3 track at a URL <a href="http://mysite.com/MP3/track1.mp3" rel="nofollow">http://mysite.com/MP3/track1.mp3</a>.
  Downloading it to a local path with NSURLConnection and NSDocumentDirectory.
  I would like to start playing this track as soon as possible and not after it is completely downloaded. Is there a while to accomplish this? I have tried setting a "X" size limit, and once the download hits that number to start playing the track. But this only plays up to the point where it was initialized at the "X" size. Thanks in advance. </p>
  
  <pre><code>- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
  
      [self.inComingData appendData:data];
      //NSLog(@"inComingData: %d", [inComingData length]);
  
      CGFloat dataLen = [[NSString stringWithFormat:@"%d",[self.inComingData length]] floatValue];
  
      NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString *documentDirectory = [paths objectAtIndex:0];
  
      appDelegate.path = [documentDirectory stringByAppendingPathComponent:@"track.mp3"];
      [self.inComingData writeToFile:appDelegate.path atomically:YES];
  
  //  NSInteger receivedLen = [self.inComingData length];
  //  if ((receivedLen &gt;= 100000) &amp;&amp; (!checked)) {
  //      //[appDelegate initAndPlay];
  //      [appDelegate playTrack];
  //      checked = TRUE;
  //  }
      [appDelegate initPlayer];
  
  }
  </code></pre>