2

There are a number of posts very similar and I've tried the suggestions from those but the error message persists. I don't believe I had the issue until going to IOS 8 but can't be sure.

I am previewing a PDF document. From a Master/detail view controller, I open an action sheet from the detail toolbar, then user selects an option to preview the PDF file. The file displays then the error shows.

I understand that it is due to one view trying to display while there is still an animation but I tried putting in delays, removing animation as suggested in some posts, but nothing works.

  case 2:  // preview the PDF file
        {
            // get a temprorary filename for this PDF
            self.pdfFilePath = [path stringByAppendingPathComponent:@"Meeting Minutes.pdf"];

            [MMPDFRenderer createPDF:@"Minutes" Meeting:_meetingItem PDFFileName:_pdfFilePath];

            // present preview.
            [self dismissViewControllerAnimated:YES completion:^{
                self.preview = [[MMPreviewController alloc] initWithNibName:nil bundle:nil];
                self.preview.delegate = self;
                self.preview.dataSource = self;
                [self presentViewController:self.preview animated:YES completion:nil];
            }];
        }
            break;

The MMPreviewController.M file..

#import "MMPreviewController.h"

@interface MMPreviewController ()
@end

@implementation MMPreviewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (BOOL)prefersStatusBarHidden
{
    return YES;
}

- (void)didReceiveMemoryWarning
{
     [super didReceiveMemoryWarning];
     // Dispose of any resources that can be recreated.
 }

@end

and the MMPreviewController.h..

#import <UIKit/UIKit.h>
#import <QuickLook/QuickLook.h>

@interface MMPreviewController : QLPreviewController

@end

Any help would be most appreciated.

Paul
  • 79
  • 11
  • 1
    Reading the other related questions, this looks like a bug in Apple's code. I don't think this has any visible effect for the user. – Thomas Deniau Jan 12 '15 at 09:48
  • Thanks Thomas, I'm tending to think that is the case. It disconcerting to any errors coming up. cheers – Paul Jan 15 '15 at 18:36
  • @ThomasDeniau It has the effect that viewWillAppear viewWillDisappear calls are no longer balanced which causes all kinds of random bugs depending on your VC implementation – trapper Apr 04 '18 at 02:43
  • Sure. This has been fixed for a while though, right? If it still happens, could you file a bug? – Thomas Deniau Apr 05 '18 at 08:39

0 Answers0