OGeek|极客世界-中国程序员成长平台

标题: iphone - 为什么我从 UITableViewcell 到 detailView 的转换不起作用? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 18:23
标题: iphone - 为什么我从 UITableViewcell 到 detailView 的转换不起作用?

这是我的代码.....

- (void)tableViewUITableView *)tableView didSelectRowAtIndexPathNSIndexPath *)indexPath
{

[tableView deselectRowAtIndexPath:indexPath animated:NO];

[self performSegueWithIdentifier"BowlerDetail" sender:self];
}

我得到的只是该单元格仍处于选中状态,而我的详细 View 未显示。是的,我已经检查过了,“BowlerDetail”是转场的名称。我收到的错误消息是 - 'NSInternalInconsistencyException',原因:'-[UITableViewController loadView] 加载了“tc8-Hk-kaK-view-YJA-Me-wti” nib 但没有得到 UITableView。

感谢任何帮助。

编辑:在 xCode 4.2 之前的日子里,这就是我之前在这里实现目标的方式。

- (void)tableViewUITableView *)tableView didSelectRowAtIndexPathNSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:NO];

DetailView *detailVC = [[DetailView alloc] initWithNibName:nil bundle:nil];

[self.navigationController pushViewController:detailVC animated:YES];


[detailVC release];
}



Best Answer-推荐答案


问题是您使用了推送转场并且没有使用 UINavigationController 作为 Root View Controller 。因此添加 UINavigationController 作为 Root View Controller 或将转场更改为模态。

关于iphone - 为什么我从 UITableViewcell 到 detailView 的转换不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8381056/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4