while loading pdf at VFR Reader get error in ios

180 views Asked by At

Its not working because I am not using ARC in project and here is my code

While download and saving 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];

While retreiving to my reader I proceed

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];
}
0

There are 0 answers