我正在使用Leaves项目在我的iphone项目中显示我的PDF,但我遇到了问题,当我试图从文档中显示PDF时,并非来自捆绑包..我认为这是简单,但有一招我不能让因为我不是在PDF阅读:)iphone sdk - 从文档目录中加载PDF
我使用下面的代码
-(void) viewWillAppear:(BOOL)animated{
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentDir = [documentPaths objectAtIndex:0];
pListPath = [ documentDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@",self.fileName]];
CFURLRef pdfURL = (CFURLRef)[NSURL fileURLWithPath:pListPath];
// CFURLRef pdfURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("fekhElSunaI.pdf"), NULL, NULL);
pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL);
NSLog(@"%@",pListPath);
// CFRelease(pdfURL);
[self init];
}
你会发现,我已经把代码大师在viewWillAppear不在初始化,因为叶做.. pdf不出现,也没有初始化 我已经使用了这个解决方案LINK并没有工作,要么
所以这里任何一个有东西帮我:)
有什么问题或问题?你说你有问题。它不显示?你有错误吗? – bryanmac
是啊,它并没有显示,尽管它得到的页数,我为什么怀疑代码的位置有问题 –