【发布时间】:2012-07-24 16:09:07
【问题描述】:
尝试使用情节提要 tableviewcontroller 实现动态表(使用代码)时,执行以下代码时无法推送详细视图。
[[self navigationController] pushViewController:previewController animated:YES];
不会抛出任何错误。没有给出任何线索,除了选定的表格单元格以蓝色突出显示并保持不变。这个问题在使用故事板时很普遍,但在使用 xibs 时则不然。
这里是didSelectRowAtIndexPath 方法:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
QLPreviewController *previewController = [[QLPreviewController alloc] init];
previewController.dataSource = self;
previewController.delegate = self;
// start previewing the document at the current section index
previewController.currentPreviewItemIndex = indexPath.row;
[[self navigationController] pushViewController:previewController animated:YES];
[previewController release];
}
这里是示例project with the issue 的链接。
【问题讨论】:
标签: ios storyboard qlpreviewcontroller