1

Options available

Hi all,

I'm creating a UIDocumentInteractionController to display a .pdf file which is saved locally in my app's document folder. Here is the code:

   if (theURLOfTheFile != nil && [theURLOfTheFile path] != nil && [[NSFileManager     defaultManager] fileExistsAtPath:filePath])
    {

        UIDocumentInteractionController *myInteractionController = [self setupControllerWithURL:theURLOfTheFile usingDelegate:self];

        self.customInteractionController = myInteractionController;
        self.customInteractionController.UTI = @"com.adobe.pdf";
        self.customInteractionController.delegate = self;
#define abf self.actionButton.frame

        //SPOT THE DIFFERENCE:


        if (!_interactionControllerVisible) {
            BOOL isValid = [self.customInteractionController presentOpenInMenuFromRect:CGRectMake(self.view.frame.size.height-100, 100, 500, 500) inView:self.view animated:YES];
        }




    } else {
        NSLog(@"Failed to open file. EscapedURL: %@",filePath);
    }

I'm not getting the preview option, but I can open it up in iBooks and it works just fine. I'd like to enable print and copy. :(

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Emile Victor
  • 923
  • 1
  • 12
  • 22

1 Answers1

1

Use presentOptionsMenuFromRect:inView:animated: instead of presentOpenInMenuFromRect:inView:animated:.

The "OpenIn" method only shows other apps. The "Options" method gives all of the other options.

rmaddy
  • 314,917
  • 42
  • 532
  • 579