title: How can I switch to another tab in UITabBarController programmatically?
body: <p>I have a UITableView and I want to switch to another tab upon clicking a cell in UITableView.</p>
  
  <p>I have already tried that but it doesn't work</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  
  MainView *mainView = [[MainView alloc] initWithNibName:@"MainView" bundle:nil];
  mainView.tabBarController.selectedIndex = 3;  
  
   }
  </code></pre>