0
我收到了一个问题,即如果我可以下载电子书文件,例如.epub或PDF,那么我在tableview
上列出这个文件,现在我选择其中一本书。是否可以通过iBook打开下载电子书文件?
我可以通过iBook打开吗?
或者我需要实现一个阅读器来打开文件?
还得到了另外一个问题,我下载一个PDF文件,我的文件夹
我登录它的路径,期待权
下面是代码:
NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)objectAtIndex:0];
NSString *ePubSubFolder = [docPath stringByAppendingPathComponent:@"Books"];
NSString *pdfPath = [ePubSubFolder stringByAppendingPathComponent:[NSString stringWithFormat:@"%@",self.pdfFileName]];
CFURLRef pdfURL = CFURLCreateWithFileSystemPath (NULL,(CFStringRef)pdfPath, kCFURLPOSIXPathStyle, FALSE);
NSLog(@"PDF URL: %@", pdfURL);
pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL);
CFRelease(pdfURL);
日志结果
../iPhone%20Simulator/4.3.2/Applications/06BA5929-3531-4AC3-B524-6CC74DC7E2C9/Documents/Books/Repeat%20After%20Me%20User's%20Guide.pdf
我做错了什么?我不会在我的视图中显示任何东西。
所有答复或非常感谢回答:-)
在IOS
谢谢!但是你有没有示例代码来展示如何显示打开文件的选项? 我真的不知道... –