QLPreviewController crashing when tapping share button, internal consistency nib bundle error

戏子无情 提交于 2019-12-11 01:36:33

问题


I'm presenting a QLPreviewController modally. Everything works-- it pops up, shows the preview item and everything. However, once the share button is tapped, the app crashes on the device and in the simulator with this:

2013-05-03 20:10:53.563 appname[16860:c07] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle <{{app_path}}> (loaded)' with name '_UIDocumentActivityViewController''

Here is the relevant code:

#pragma mark HVSchedulesDelegate

- (void)schedulePDFReceived {
    QLPreviewController *previewController = [[QLPreviewController alloc] init];
    [previewController setDataSource:self];

    [self presentViewController:previewController animated:YES completion:nil];
}

#pragma mark QLPreviewControllerDataSource

- (NSInteger) numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller {
    return 1;
}

- (id <QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index {
    return [NSURL fileURLWithPath:self.schedulesProxy.pdfPath];
}

来源:https://stackoverflow.com/questions/16369676/qlpreviewcontroller-crashing-when-tapping-share-button-internal-consistency-nib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!