title: UITabBarController.selectedIndex returning wrong value
body: <p>I have a <code>UITabBarController</code> with two tabs. Each tab has the same <code>UISplitViewController</code> within itself. I want to see the value of selected index of tabbarcontroller to see which splitview is open right now insidethe <code>MasterViewController</code> in <code>UITableViewDelegate</code> method, but it returns me the wrong value. It always returns 0 even if the index 1 is selected.</p>
  
  <p>In appdelegate, I have initialized both of them by the same code in a loop this way:</p>
  
  <pre><code>             MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController_iPad" bundle:nil];
  
               UINavigationController *masterNavigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController];
  
               detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController_iPad" bundle:nil];                 
               UINavigationController *detailNavigationController = [[UINavigationController alloc] initWithRootViewController:detailViewController];
  
               masterViewController.detailViewController = detailViewController;
  
               self.splitViewController = [[UISplitViewController alloc] init];
               splitViewController.tabBarItem = controller.tabBarItem;
               self.splitViewController.delegate = detailViewController;
               self.splitViewController.viewControllers = @[masterNavigationController, detailNavigationController];
               [controllers replaceObjectAtIndex:index withObject:splitViewController];
  </code></pre>
  
  <p>}</p>
  
  <p>Any help would be largely appreciated! I think it might be some issue with the splitViewController because it works fine on iPhone.</p>