我在didSelectRowAtIndexPath中执行以下代码,文档正在打开,但未删除右侧导航项。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (url) {
self.pdf_viewer = [UIDocumentInteractionController interactionControllerWithURL:url];
[self.pdf_viewer setDelegate:self];
[self.pdf_viewer presentPreviewAnimated:YES];
}
}
和
- (UIViewController *)documentInteractionControllerViewControllerForPreview: (UIDocumentInteractionController *) controller {
self.navigationItem.rightBarButtonItem = nil;
return self;
}
答案 0 :(得分:0)
在文档打开时,执行rightBarButtonItem = nil
if (url) {
self.pdf_viewer = [UIDocumentInteractionController interactionControllerWithURL:url];
[self.pdf_viewer setDelegate:self];
[self.pdf_viewer presentPreviewAnimated:YES];
self.navigationItem.rightBarButtonItem = nil;
}
关闭文档后再次设置按钮..