Note that there are some explanatory texts on larger screens.

plurals
  1. POUIDocumentInteractionController crashing upon exit
    primarykey
    data
    text
    <p>I have a regular UIButton on my main menu that currently launches a UIViewController; the contents of the corresponding .m file is as follows:</p> <pre><code>-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; documentPath = [[NSBundle mainBundle] pathForResource:@"file" ofType:@"pdf"]; NSURL *targetURL = [NSURL fileURLWithPath:documentPath]; document = [UIDocumentInteractionController interactionControllerWithURL: targetURL]; document.delegate = self; [document retain]; return self; } -(UIViewController *)documentInteractionControllerViewControllerForPreview: (UIDocumentInteractionController *) controller { return self; } -(void)documentInteractionControllerDidEndPreview:(UIDocumentInteractionController *)controller { [document autorelease]; } -(void)viewDidLoad { [super viewDidLoad]; [document presentPreviewAnimated: YES]; // ** CRASH ** } -(void)viewDidUnload { [super viewDidUnload]; } -(void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } -(void)dealloc { [super dealloc]; } </code></pre> <p>My pdf file loads as expected, however when I hit the "done" button the document closes and I am left staring at my blank UIViewController - arguably as expected. But if I hit the navigation "back" button then the app crashes with a bad access error inside my viewDidLoad method, where the call to presentPreviewAnimated is found.</p> <p>If somebody could please take a look, I would be most grateful.</p> <p>(btw, there is no NIB file when this view controller is created. Yes, this in itself is wrong)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload