title: How to download a file even when the app goes into the background?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3612963/download-in-background-in-iphone">Download in background in iPhone</a>  </p>
  </blockquote>
  
  
  
  <p>I'm downloading a file in my app, using <code>connection:didReceiveData:</code> in <code>NSURLConnectionDelegate</code>. If I press the home button then the download is stopped. The delegate is not getting called to receive data.</p>
  
  <p>When the app goes to the background, the app must continue downloading the file. How can I implement this?</p>
  
  <p>There is a method <code>beginBackgroundTaskWithExpirationHandler:</code> to start a finite-length task in background, is that what I need?</p>