I've a problem with UIDocumentInteractionController. I'm able, through presentOptionsMenuFromBarButtonItem, to display the popover correctly.
When the user touch the barbuttonitem I fire the following method:
- (IBAction)share:(id)sender {
if (docIntController) {
[docIntController dismissMenuAnimated:NO];
docIntController = nil;
}
NSString *fileURL = [(Documents *)(self.detailItem) url];
NSArray *subStrings = [fileURL componentsSeparatedByString:@"/"];
NSString *filePath = [[self documentsDirectory] stringByAppendingPathComponent:[subStrings lastObject]];
docIntController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:filePath]];
docIntController.delegate = self;
docIntController.UTI = @"com.adobe.pdf";
[docIntController presentOptionsMenuFromBarButtonItem:sender animated:YES];
}
Anyway, when the user touches the print button, and then again the barbutton, the print option menu will not disappear, as you can see in the following image:
Moreover, if the user touches the print option again, the option popover will disappear (but not the old print option) and another print option popover will be created.
Indeed if the user touches outside of the popover to dismiss it, only the first one will be dismissed and the old one is empty as shown below: