而在VFR阅读器加载PDF在iOS错误(while loading pdf at VFR Reade

2019-10-19 02:30发布

因为我不是在项目中使用ARC,在这里它不工作是我的代码

虽然下载和保存PDF

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
NSString *documentsDirectory = [paths objectAtIndex:0]; 
NSString *comicbook_id = [[NSUserDefaults standardUserDefaults]stringForKey:@"comicbook_id"];
NSString *filePath = [NSString stringWithFormat:@"%@/book_%@.pdf", documentsDirectory,comicbook_id];

虽然retreiving到我的读者我继续

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
NSString *documentsDirectory = [paths objectAtIndex:0]; 
NSString *comicbook_id = [[NSUserDefaults standardUserDefaults]stringForKey:@"comicbook_id"]; 
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"book_%@.pdf",comicbook_id]];

NSLog(@"date==>%@",documentsDirectory);
NSString *phrase = nil;
ReaderDocument *document = [ReaderDocument withDocumentFilePath:filePath password:phrase];
NSLog(@"document==>%@",document);
if (document != nil) {
   ReaderViewController *readerViewController = [[ReaderViewController alloc] initWithReaderDocument:document];
   readerViewController.delegate = self;
   readerViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
   readerViewController.modalPresentationStyle = UIModalPresentationFullScreen;
   [self presentViewController:readerViewController animated:YES completion:nil];
}
文章来源: while loading pdf at VFR Reader get error in ios