2012-10-24 28 views
8

iPad chỉ: UIDocumentInteractionController presentPreviewAnimated không đẩy vào menu ngăn xếp và chỉ được hiển thị modally ngay cả khi một bộ điều khiển chuyển hướng được trả về từ documentInteractionControllerViewControllerForPreviewlỗi Dự đoán trên thiết bị iPad cho UIDocumentInteractionController: presentPreviewAnimated không đẩy vào menu ngăn xếp

Hi Tôi tự hỏi nếu có ai có thể giúp tôi ở đây và tôi tin rằng đây có thể là một lỗi liên quan đến iPad chỉ (nó hoạt động trên iPhone) nhưng muốn xác nhận trước khi tôi tập tin này.

Để nhận UIDocumentInteractionController làm việc trong bộ điều khiển điều hướng, tôi đã làm theo cách tiếp cận được khuyến nghị bằng cách trả về biểu mẫu điều khiển chuyển hướng documentInteractionControllerViewControllerForPreview nhưng nó không hoạt động.

Tôi thậm chí đã thử mẫu mã UIDocumentInteractionController do Apple cung cấp bằng cách nâng cấp lên iPad và đủ chắc chắn, bộ điều khiển tương tác tài liệu được hiển thị bình thường ngay cả khi tôi trả về bộ điều khiển điều hướng từ documentInteractionControllerViewControllerForPreview. Tuy nhiên đối với iPhone, nó được đẩy vào ngăn xếp Navigation.

Tôi đang cố gắng thiết kế ứng dụng dựa trên chế độ xem chia nhỏ đọc tệp PDF bằng bộ điều khiển tương tác doc, như PDF sẽ hiển thị trong DetailViewController, nhưng điều này chỉ hoạt động cho QLPreviewController (không phải bộ điều khiển tương tác Doc).

Có ai có vấn đề với điều này không? Ive đặt mã mẫu của tôi bên dưới với hình ảnh về những gì tôi thấy:

Tôi đang sử dụng 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]; 
} 

Đây là những gì tôi nhìn thấy trên iPad

This is what I see on the iPad tôi cần phải hiển thị nó lên như thế này (cùng mẫu mã trên iPhone)

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

+0

Tôi đã tạo một dự án mẫu đơn giản thể hiện sự cố: https://github.com/kristopherjohnson/DocumentPreviewTest –

Trả lời

2

Tôi đã gửi một lỗi báo cáo cho Apple. Báo cáo của tôi (http://www.openradar.me/radar?id=2785401) đã bị đóng dưới dạng Bản sao ID lỗi # 12567789. Vì vậy, rõ ràng đây là sự cố đã biết.

Các vấn đề liên quan