Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableViewController withing UITabBarController does not show up
    text
    copied!<p>I have ran into an interesting situation, I have an iPhone app with 3 <code>UITableViewController</code>s each displaying more or less the same data (you can say it's a matter of filtering). To date I had 3 separate NIBs for this, each with it's own controller, additionally the <code>UITableViewController</code>s were inside <code>UINavigationController</code> for the sake of buttons on top.</p> <p>Now to optimize the app and reduce it's footprint, I pack all the logic to one common controller (an <code>UITableViewController</code>) and left only one NIB in place. The common controller would take care of filtering the data out, and pointing to the correct data. </p> <p>So, I load the <strong>same</strong> common controller to 3 of the navigation controllers:</p> <pre><code>navControllerA = [[UINavigationController alloc] initWithRootViewController: commonTableController]; </code></pre> <p>and added these navigation controllers to the <code>UITabBarController</code>:</p> <pre><code>navigationControllersArray = [NSArray arrayWithObjects: navControllerA, navControllerB, navControllerC, nil]; [tabController setViewControllers:[NSArray arrayWithArray:navigationControllersArray]]; </code></pre> <p>Now all is fine, the tabs display, the table views show up. But once you touch the next <code>UITabBarItem</code> and go back to the previous one the <code>UITableViewController</code> doesn't show, you can only see a <code>UIWindow</code> in it's place. The <code>UITableViewController</code> stays visible only for the last touched <code>UITabBarItem</code>.</p> <p>Is there some kind of <code>UITabBar</code>view loading mechanism I'm not aware of?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload