Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
N内部一致性异常PDF查看器_Pdf_Viewer - Fatal编程技术网

N内部一致性异常PDF查看器

N内部一致性异常PDF查看器,pdf,viewer,Pdf,Viewer,我从Julius Oklamcak那里复制了一些好的pdf查看代码。 当我不修改他的应用程序时,它在他的应用程序中工作得很好,但当我把它放在我自己的应用程序中时,它会变得一团糟。 我删除了打印、书签和平铺视图按钮供参考 “完成”按钮不工作 以下是我收到的错误: 2012-12-18 10:01:45.857 TeacherTableView4[1147:907] *** Assertion failure in -[ReaderViewController tappedInToolbar:don

我从Julius Oklamcak那里复制了一些好的pdf查看代码。 当我不修改他的应用程序时,它在他的应用程序中工作得很好,但当我把它放在我自己的应用程序中时,它会变得一团糟。 我删除了打印、书签和平铺视图按钮供参考

“完成”按钮不工作

以下是我收到的错误:

2012-12-18 10:01:45.857 TeacherTableView4[1147:907] *** Assertion failure in -[ReaderViewController tappedInToolbar:doneButton:], (...my path to)/TeacherTableView4/ReaderViewController.m:844
2012-12-18 10:01:45.859 TeacherTableView4[1147:907] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Delegate must respond to -dismissReaderViewController:'
*** First throw call stack:
(0x371b52a3 0x3bd9497f 0x371b515d 0x3a2682af 0x40967 0x3c9f1 0x3676f0a5 0x3676f057 0x3676f035 0x3676e8eb 0x3676ede1 0x366975f1 0x36684801 0x3668411b 0x34a4f5a3 0x34a4f1d3 0x3718a173 0x3718a117 0x37188f99 0x370fbebd 0x370fbd49 0x34a4e2eb 0x366d82f9 0x414bd 0x36557b20)
libc++abi.dylib: terminate called throwing an exception
代码如下:

- (void)tappedInToolbar:(ReaderMainToolbar *)toolbar doneButton:(UIButton *)button
{
#ifdef DEBUGX
    NSLog(@"%s", __FUNCTION__);
#endif

#if (READER_STANDALONE == FALSE) // Option

[document saveReaderDocument]; // Save any ReaderDocument object changes

[[ReaderThumbQueue sharedInstance] cancelOperationsWithGUID:document.guid];

[[ReaderThumbCache sharedInstance] removeAllObjects]; // Empty the thumb cache

//COMMENTED OUT BY ME
//if (printInteraction != nil) [printInteraction dismissAnimated:NO]; // Dismiss

if ([delegate respondsToSelector:@selector(dismissReaderViewController:)] == YES)
{
    [delegate dismissReaderViewController:self]; // Dismiss the ReaderViewController
}
else // We have a "Delegate must respond to -dismissReaderViewController: error"
{
    NSAssert(NO, @"Delegate must respond to -dismissReaderViewController:");
}

#endif // end of READER_STANDALONE Option
}

我真的很感激你能帮我。谢谢

使用此PDF查看代码时,我遇到了相同的问题。我只是添加了这个方法

- (void)dismissReaderViewController:(ReaderViewController *) viewController 
{
[self dismissModalViewControllerAnimated:YES];
}
我正在调用
-(iAction)的.m文件中单击打开。
这主要是因为在ReaderViewController.m中,委托人希望看到dismissReaderViewController在您的实现文件中声明。否则,它会抛出你所得到的错误


注意:使用
[自解除视图控制器激活:是完成:无]用于iOS6或更高版本,因为DismissModalViewController无效:不推荐使用YES:-)

使用此PDF查看代码时,我遇到了相同的问题。我只是添加了这个方法

- (void)dismissReaderViewController:(ReaderViewController *) viewController 
{
[self dismissModalViewControllerAnimated:YES];
}
我正在调用
-(iAction)的.m文件中单击打开。
这主要是因为在ReaderViewController.m中,委托人希望看到dismissReaderViewController在您的实现文件中声明。否则,它会抛出你所得到的错误


注意:使用
[自解除视图控制器激活:是完成:无]用于iOS6或更高版本,因为DismissModalViewController已启用:是已弃用:-)

是!非常感谢你的帮助。现在工作得很好。是的!非常感谢你的帮助。现在工作得很好。