我的应用程序中有两个选项卡,左边的选项卡是普通的UIViewController,右边的选项卡是一个包含表格视图的导航控制器。我希望允许用户在左侧选项卡上按下一个按钮,并跳转到右侧选项卡中表格视图中特定行所属的具体详细信息视图。
在表格视图本身中,我没有问题显示特定的详细信息视图,例如:
[self.navigationController pushViewController:theView animated:YES];
我可以使用以下方法来切换标签页:
self.tabBarController.selectedIndex = 1; // 1= right tab
但我不知道如何同时做到这两点。我已经尝试过。
self.tabBarController.selectedIndex = 1; // 1= right tab
// alloc and init theView here
[self.navigationController pushViewController:theView animated:YES];
但这并不起作用。
编辑:
当我尝试上面的代码时,它只是切换了选项卡,但没有推送视图。
我也尝试了criscokid建议的方法,但什么都没有发生。
编辑2:
试图解释每个选项卡上的内容:
根(选项卡控制器) | --(左选项卡)--UIViewController(我想从这里去...) | --(右选项卡)---UINavigationController | ---UITableViewController | ----UIViewController(...到这里) ^具有特定行中数据的特定视图 在表格视图中(即上面的“theView”)