iphone - NSInternalInconsistencyException 为 'CGPDFDocumentRef == NULL'

标签 iphone xcode cocoa-touch pdf newsstand-kit

我正在构建一个报亭通用应用程序。当我下载一期杂志并打开它时,它运行正常,但是当我删除它,重新下载并打开它时,它会抛出以下错误:

2013-04-01 22:06:07.672 Magazine[14353:707] *** Assertion failure in -[ReaderContentPage initWithURL:page:password:], /Volumes/Files/Work in progress/el-beit/Magazine/Sources/ReaderContentPage.m:471
2013-04-01 22:06:07.680 Magazine[14353:707] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'CGPDFDocumentRef == NULL'
*** First throw call stack:
(0x35a4788f 0x3366b259 0x35a47789 0x34e3b3a3 0x84e59 0x85ba7 0x96d47 0x976ad 0x34e6d933 0x35a1ba33 0x35a1b699 0x35a1a26f 0x3599d4a5 0x3599d36d 0x33738439 0x33175cd5 0x6cf81 0x6cf08)
terminate called throwing an exception(lldb)

我通过删除其问题来删除文件:

NKLibrary *nkLib = [NKLibrary sharedLibrary];
NKIssue *issue = [nkLib issueWithName:[kBaseFeatureID stringByAppendingString:((NSNumber *)self.listOfMonths[index]).stringValue]];
NSString *name = issue.name;
[nkLib removeIssue:issue];
[nkLib addIssueWithName:name date:[self.dateFormatter dateFromString:((NSNumber *)self.listOfMonths[index]).stringValue]];

我使用的是Newsstand、iOS6、Xcode 4.6、MKStoreKit,以及这个项目的模板:https://github.com/vfr/Reader

读者似乎试图打开已删除的文件,而不是我提供给它的文件。

如有任何帮助,我们将不胜感激,提前致谢。

最佳答案

我通过使用解决了这个问题

[[ReaderDocument alloc] initWithFilePath:file password:nil];

而不是

[ReaderDocument withDocumentFilePath:file password:nil];

关于iphone - NSInternalInconsistencyException 为 'CGPDFDocumentRef == NULL',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15751246/

相关文章:

ios - 在锁定屏幕上显示通知

iphone - 如何将 UIImage 保存到文件中?

ios - 变量已写入,但从未读取过?

iphone - 选择 UIPickerView 项目时运行 ibaction

ios - 锁定 UIAccessibility 焦点的方法

ios - 无法使用内部使用 .xib 文件的 iOS 框架

iphone - XCODE:对 <UIFileUploadFallbackRootViewController 开始/结束外观转换的不平衡调用

iphone - 使用 iPhone Sharekit 在一篇文章中发布多个网址

iphone - iOS 将 iOS 库音乐传输到多个 iOS 设备

ios - 自动刷新tableview 无需拉动刷新