开发者

How can I change to a different view within a different navigation controller than I'm in at the moment

开发者 https://www.devze.com 2023-01-25 23:42 出处:网络
I have a tab bar controller and a navigation controller. Each tab bar item has its own navigation controller and a few views within those.

I have a tab bar controller and a navigation controller. Each tab bar item has its own navigation controller and a few views within those.

I want to programitically switch to another view in a another navigation controller and have the correct corresponding tab bar item selected.

Is this possible, if so can you show me how ?

Heres so开发者_高级运维me typical lines I'm using at the moment within the same navigation controllers.

[delegate.settingsNavController pushViewController:nextController animated:YES];
[delegate.reportNavController pushViewController:nextController animated:YES];

When ever I try this, nothing happens, I stay in the current view, however if I were to tap another navigation button and the view I'd tried (with code) wasn't normally the first view, that view would show first.

So it is changing the view within the navigation controller, but its not showing it.


You also have to switch to the new tab:

self.navigationController.tabBarController.selectedIndex = settingsTabIndex;
[delegate.settingsNavController pushViewController:nextController animated:YES];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号