Add / remove view controllers to tab bar controller


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #import "RegisterViewController.h"
  2.  
  3. //
  4.  
  5. UIViewController *viewController3 = [[[RegisterViewController alloc] initWithNibName:@"RegisterViewController" bundle:nil] autorelease];
  6.  
  7.  
  8. NSMutableArray* controllers = [[self.tabBarController.viewControllers mutableCopy] autorelease];
  9. [controllers removeObjectAtIndex:1];
  10. [controllers insertObject:viewController3 atIndex:0];
  11. [self.tabBarController setViewControllers:controllers animated:YES];

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.