读者框架无法在ios中使用我的应用程序

时间:2013-12-06 06:09:17

标签: ios5 nsfilemanager

我已将这些pdf文件从url保存到目录
这是我的代码

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

我正从目录中检索此文件以加载ReaderViewController

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);

ReaderDocument *document = [ReaderDocument withDocumentFilePath:filePath password:nil];
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 个答案:

没有答案