我对IOS开发新我工作的PDF应用程序,我需要存储在一个NSData的变量PDF文件,我有PDF路径,但我得到这个消息错误,当我试图把这个PDF上的NSData使用dataWithContentsOfFile她是我的简单的代码变量:
NSError *error;
NSString *PdfPath = [NSString stringWithFormat:(@"%@"),document.fileURL ];
NSString *newPath = [PdfPath stringByReplacingOccurrencesOfString:@"file://localhost" withString:@""];
NSLog(@"OriginalPdfPath => %@", newPath);
NSData *pdfData = [NSData dataWithContentsOfFile:newPath options:NSDataReadingUncached error:&error];
注:该PDF路径的格式如下:/Users/bluesettle/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/BBEF320E-7E2A-49DA-9FCF-9CFB01CC0402/ContractApp.app/Pro.iOS.Table.Views .PDF
谢谢你的帮助