Note that there are some explanatory texts on larger screens.

plurals
  1. PORemove Unused ViewControllers
    primarykey
    data
    text
    <p>When I click in the TTTabBar, the tabs elected sends me to one the the correct ViewController, then I click another TTTabBar it will send me to the other one.....etc, but how can I remove the last ViewController, so they don't just keep stacking on top of each other.</p> <pre><code>- (void)tabBar:(TTTabBar*)tabBar tabSelected:(NSInteger)selectedIndex { if(selectedIndex == 0){ UIViewController* viewController = (UIViewController*)[[TTNavigator navigator] viewControllerForURL:@"tt://Forum"]; [self.view addSubview:viewController.view]; [self.view addSubview:_tabBar]; }else if(selectedIndex == 1) { UIViewController* viewController = (UIViewController*)[[TTNavigator navigator] viewControllerForURL:@"tt://Profile"]; [self.view addSubview:viewController.view]; [self.view addSubview:_tabBar]; }else if(selectedIndex == 2) { UIViewController* viewController = (UIViewController*)[[TTNavigator navigator] viewControllerForURL:@"tt://PMs"]; [self.view addSubview:viewController.view]; [self.view addSubview:_tabBar]; }else if(selectedIndex == 3) { UIViewController* viewController = (UIViewController*)[[TTNavigator navigator] viewControllerForURL:@"tt://Friends"]; [self.view addSubview:viewController.view]; [self.view addSubview:_tabBar]; } } </code></pre> <p>I got this to work</p> <pre><code>if ([viewController isKindOfClass:[UIViewController class]]) { [viewController.view removeFromSuperview]; } else { } </code></pre> <p>when i added it above </p> <pre><code> if(selectedIndex == 0){ </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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