gpt4 book ai didi

objective-c - 为什么 NavigationController 不推送 View ?

转载 作者:行者123 更新时间:2023-12-01 16:59:58 26 4
gpt4 key购买 nike

我花了将近一天的时间来解决这个问题,请有人帮助我!我正在尝试从 tableview Controller 推送 View 。它没有响应。

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NewsDetailViewController *ndvc = [[NewsDetailViewController alloc] initWithNibName:@"NewsDetailViewController" bundle:nil];
[self.navigationController pushViewController:ndvc animated:YES];
}

最佳答案

我猜你的 self.navigationControllernil .从我得到的评论中,你不使用导航 Controller 。我想说,使用导航 Controller 创建一个基于窗口的应用程序作为 rootViewController并在其中添加 tableViewnavigationController 的 View 然后你应该没有问题。

关于objective-c - 为什么 NavigationController 不推送 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7986284/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com