readerController.delegate不会解除ModalViewController

时间:2012-12-03 03:32:47

标签: ios xcode pdf viewer

我已将vfr Reader框架添加到我的应用程序中,我可以查看pdf,但是当我想通过电子邮件发送pdf或取消电子邮件时,模态视图不会被忽略。我正在使用iOS 6& xcode 4.5。到目前为止,这是我的代码:

#pragma mark - Reader method

- (IBAction)didViewPdf {

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);

    NSString *myPath = [paths objectAtIndex:0];

    myPath = [myPath stringByAppendingPathComponent:@"karahipi.pdf"];

    ReaderDocument *document = [ReaderDocument withDocumentFilePath:myPath password:nil];

    if (document != nil) {

        readerViewController = [[ReaderViewController alloc] initWithReaderDocument:document];
        readerViewController.delegate = self;
        readerViewController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]];
        readerViewController.navigationController.navigationBar.tintColor = [UIColor blackColor];

        readerViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
        readerViewController.modalPresentationStyle = UIModalPresentationFullScreen;

        [self presentViewController:readerViewController animated:YES completion:nil];

    }

}

#pragma mark - Reader delegate metho

- (void)dismissReaderViewController:(ReaderViewController *)viewController {

    [self dismissModalViewControllerAnimated:YES];
}

我已经在iOS 6中运行了它作为目标的演示。

0 个答案:

没有答案