2012-03-07 15 views

答えて

0
//---get the path of the Documents folder--- 
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory , NSUserDomainMask, YES); 

NSString *documentsDir = [paths objectAtIndex:0]; 

NSString *filePath = [documentsDir stringByAppendingPathComponent:"newPdf.pdf"]; 

pdf = CGPDFDocumentCreateWithURL((CFURLRef)filePath); 
NSLog(@"pdfurl %@",filePath); 

CFRelease(pdfURL); 

このことについて主なリソースフォルダ

pdfURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("newPdf.pdf"), NULL, NULL); 

    pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL); 
    NSLog(@"pdfurl %@",pdfURL); 

    CFRelease(pdfURL); 

任意のアイデアをフォルダではなくどのように私はpdfURLつま先は、ドキュメント/からPDFを入手伝えることができるということですディレクトリにファイルする。

+0

@Sreekumar Kalarikkalさんのお返事ありがとうございます。私はこのことをしましたが、問題はどのようにしてpdfURL = CFBundleCopyResourceURL(CFBundleGetMainBundle()、CFRP( "newPdf.pdf")、NULL、NULL)にfilePathを与えることができるかです。 pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL); NSLog(@ "pdfurl%@"、pdfURL); – Developer

+0

代用pdfURL with filePath –

+0

私は私の答えを編集しました。私はそれをチェックしませんでした。しかし、それは助けるかもしれません。 –

関連する問題