title: Download files from UIDocumentPicker and wait until download has finished
body: <p>I'm trying to download a file from the</p>
  
  <pre><code>-documentPicker:didPickDocumentAtURL:
  </code></pre>
  
  <p>method.
  I've tried to get the data of the file using</p>
  
  <pre><code>NSData *data = [NSData dataWithContentsOfURL:url];
  </code></pre>
  
  <p>but it didn't work how I expected, because the UIDocumentPicker fires the -documentPicker:didPickDocumentAtURL: -method before the file is downloaded.</p>
  
  <p>How can I get the NSData from the file when it's downloaded?</p>
  
  <p>Thanks in advance, Fabian.</p>