title: Reloading tabs in an iPhone tabbar and setting the selected index
body: <p>I am having trouble reloading the tabs in a tab bar and then having the correct tab selected.</p>
  
  <p>When a user chooses a particular function in my app - this means I need to reload the tab bar at the bottom of the screen - and sometimes add buttons and other times remove.</p>
  
  <p>I am able to reload the data using:</p>
  
  <pre><code>[self.tabBarController setViewControllers:controllers animated:YES];
  </code></pre>
  
  <p>but I can't get the selectedViewIndex to work propery it just seems to get ignored:</p>
  
  <pre><code>self.tabBarController.selectedIndex = [controllers count]-1;
  </code></pre>
  
  <p>I want to have the last tab selected - but after this code has run it is always the first tab that is selected - Any ideas?</p>