简体   繁体   English

如何设置在iPad中打开iBooks中存储的pdf文件的路径

[英]How to set a path for opening the pdf file stored in iBooks in iPad

I write the code to open the pdf file located 我编写代码以打开位于的pdf文件

  NSArray  *paths =    NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, YES);
        NSString *documentsDir = [paths objectAtIndex:0];
        NSString *pdfFilePath =[documentsDir  stringByAppendingPathComponent:@"421_core_animation_essentials.pdf"];
        fileURL = [NSURL URLWithString:pdfFilePath];
        QLPreviewController *previewController = [[QLPreviewController alloc] init];
        previewController.dataSource = self;
        [[self navigationController] pushViewController:previewController animated:YES];
        [previewController.navigationItem setRightBarButtonItem:nil];
        [previewController release];

It is working while testing in simulator but when testing in iPad device it doesn't work. 在模拟器中进行测试时,它可以工作,但在iPad设备中进行测试时,则不起作用。 please help me. 请帮我。

iOS device file systems are case-sensitive unlike the simulator which isn't. iOS设备文件系统区分大小写,与模拟器不同。

Therefore check the filename for case sensitivity on: 因此,请检查文件名是否区分大小写:

NSString *pdfFilePath =[documentsDir  stringByAppendingPathComponent:@"421_core_animation_essentials.pdf"];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM