Probable iPad error for UIDocumentInteractionController: presentPreviewAnimated is not pushed onto the navigation stack

IPad only: UIDocumentmentInteractionController presentPreviewAnimated is not pushed onto the navigation stack and is only displayed if the navigation controller returns from the InteractionControllerViewControllerForPreview

Hello to all

I wonder if anyone can help me here, and I believe that this may be a bug related only to the iPad (it works on the iPhone), but I wanted to get confirmation before I do this.

To get a UIDocumentInteractionController working in a navigation controller, I followed the recommended approach by returning the form of the navigation controller documentInteractionControllerViewControllerForPreview, but it does not work.

I even tried using the UIDocumentInteractionController code sample for Apple, upgrading it to iPad and, of course, the document interaction controller is displayed modally, even if I return the navigation controller from the InteractionControllerViewControllerForPreview document. However, for the iPhone, it gets on the navigation stack.

I am trying to create a splitviewcontroller based application that reads PDF files using the doc interaction controller so that the PDF will be displayed in the DetailViewController, but this only works for the QLPreviewController (and not for the Doc interaction controller).

Does anyone have a problem with this? Ive put my sample code below with an image of what I see:

Im using iOS 6.0 SDK.

static NSString* documents2[] = { @"PDF Document.pdf" }; @implementation WhizTBViewController @synthesize documentURLs, docInteractionController; #pragma mark - #pragma mark View Controller - (void)setupDocumentControllerWithURL:(NSURL *)url { if (self.docInteractionController == nil) { self.docInteractionController = [UIDocumentInteractionController interactionControllerWithURL:url]; self.docInteractionController.delegate = self; } else { self.docInteractionController.URL = url; } } - (void)previewDocument { // three ways to present a preview: // 1. Don't implement this method and simply attach the canned gestureRecognizers to the cell // // 2. Don't use canned gesture recognizers and simply use UIDocumentInteractionController's // presentPreviewAnimated: to get a preview for the document associated with this cell // // 3. Use the QLPreviewController to give the user preview access to the document associated // with this cell and all the other documents as well. // for case 2 use this, allowing UIDocumentInteractionController to handle the preview: NSURL *fileURL; fileURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:documents[0] ofType:nil]]; [self setupDocumentControllerWithURL:fileURL]; [self.docInteractionController presentPreviewAnimated:YES]; } #pragma mark - #pragma mark UIDocumentInteractionControllerDelegate - (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)interactionController { return [self navigationController]; } 

This is what I see on the iPad.

This is what I see on the iPad I need to show it like this (same code example on iPhone)

I need to show it up like this (same sample code on the iPhone):

+8
document ios6 controller modalviewcontroller interaction
source share
1 answer

I sent an Apple error report. My report ( http://www.openradar.me/radar?id=2785401 ) was closed as a duplicate of error identifier No. 12567789. This seems to be a known issue.

+2
source share

All Articles