title: iOS QLPreviewController show pdf saved to file system
body: <p>I have QLPreviewController working if I show a PDF file system from my bundle on the project,</p>
  
  <p>like this <a href="http://iosdevelopertips.com/data-file-management/preview-documents-with-qlpreviewcontroller.html" rel="nofollow">example</a></p>
  
  <p>but If I want to show a PDF from the file system, it doesnt show it, how can I call a pdf file that I have just downloaded in my file system?</p>
  
  <p>The code:</p>
  
  <pre><code>- (void)initPDFviewer
  {
      QLPreviewController *previewController=[[QLPreviewController alloc]init];
      previewController.delegate=self;
      previewController.dataSource=self;
      [self presentModalViewController:previewController animated:YES];
      [previewController.navigationItem setRightBarButtonItem:nil];
  }
  
  - (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller
  {
      return 1;
  }
  - (id &lt;QLPreviewItem&gt;)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index
  {
      //return 0;
  
  
      //return url!
  
  
      NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  
      NSLog(@"paths :: %@", paths);
  
      return 0;
  
  }
  </code></pre>
  
  <p>So my problem is how to get the pdf [only pdf in the documents directory], how do i get this pdf?</p>
  
  <p>thanks</p>
  
  <p>thanks!</p>