1

I am trying to develop carrier form in my app,here i am trying to implement resume upload(file uploading) in my app.Here i am write code for open file manager but i don't know how to pick pdf files in file manager.please any one help to finish this .thanks in advance.

 UIButton *button = (UIButton *)sender;
    NSURL *URL = [[NSBundle mainBundle] URLForResource:@"test" withExtension:@"pdf"];

    if (URL) {
        // Initialize Document Interaction Controller
        self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:URL];

        //Configure Document Interaction Controller
        [self.documentInteractionController setDelegate:self];

        // Present Open In Menu
        [self.documentInteractionController presentOpenInMenuFromRect:[button frame] inView:self.view animated:YES];

    }

this is the code i am using for open file manager.

  • Welcome to Stackoverflow. Please read http://stackoverflow.com/help/how-to-ask and also make sure that you include the code you are asking about. – Jason Aller Mar 27 '15 at 04:51

1 Answers1

0

Try This

 NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,            
 NSUserDomainMask, YES); 
 NSString *docsDirectory = [path objectAtIndex:0]; 
 NSString *filePath = [docsDirectory stringByAppendingPathComponent:@“sample.pdf"];
 NSURL *pdfUrl = [NSURL fileURLWithPath:filePath];
 pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL);
Yash Joshi
  • 199
  • 8
  • 17