I have QLPreviewController working if I show a PDF file system from my bundle on the project,
like this example
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?
The 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 <QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index
{
//return 0;
//return url!
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSLog(@"paths :: %@", paths);
return 0;
}
So my problem is how to get the pdf [only pdf in the documents directory], how do i get this pdf?
thanks
thanks!