我正在以模态方式呈现QLPreviewController。一切正常 - 它弹出,显示预览项目和一切。但是,一旦点击了分享按钮,应用程序就会在设备上和模拟器中崩溃:
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''
以下是相关代码:
#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];
}