我有这个预览PDF文件的代码:
QLPreviewController *previewController=[[QLPreviewController alloc]init];
previewController.delegate=self;
previewController.dataSource=self;
[self presentModalViewController:previewController animated:YES];
现在,当我关闭QLPreviewController
或previewController
时,会调用此方法:
- (void)previewControllerDidDismiss:(QLPreviewController *)controller {
NSLog(@"You closed the document");
}
现在,当我调用此方法时,如何返回文档或Pdf的URL:
- (void)previewControllerDidDismiss:(QLPreviewController *)controller {
//here I need to be able to get the PDF's URL or Data when is closed
}
有人可以帮忙吗?
非常感谢。
答案 0 :(得分:0)
检查文档here。还有另一种方法,它响应用户操作并返回所需的URL:
- (BOOL)previewController:(QLPreviewController *)controller
shouldOpenURL:(NSURL *)url
forPreviewItem:(id<QLPreviewItem>)item