Search code examples
iphoneios6uitabcontroller

Present a viewcontroller inside a navigationcontroller from another tab in tabbed application


I have a tabbed application and each tab has a navigation controller with table views in it.

In one of the view from a tab, I want to present the first view controller of another tab.

My tabViewController.viewControllers has an array of navigation controllers for each tab.

I cant seem to present the view controller directly without accessing the navigation controller and I guess you cant present a navigation controller. What am I doing wrong??


Solution

  • If I understood you correctly, you can access to your root controller something like that: [[tabViewController.viewControllers objectAtIndex:index] objectAtIndex:0], but I dont think you can display one view twice. So you still should recreate this view controller to display it in another tab as childViewController, for example