0

I am having Loginview controller,I have created it with Xib and i want to push mainstoryboard on clicking loginbutton.

LoginViewController *lObjloginview = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
UINavigationController *lObjtempview = [[UINavigationController alloc] initWithRootViewController:lObjloginview];
self.window.rootViewController = lObjtempview;
[self.window makeKeyAndVisible];

This will add loginview from xib.but after pressing loginbutton I want to load storyboard.Can anyone help me in pushing mainstoryboard which has tabbar controller inside mainstoryboard to link xib.

NHS
  • 409
  • 2
  • 7

1 Answers1

1

Load the initial view controller from the storyboard and present it

UIStoryboard * storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController * initialVC = [storyboard instantiateInitialViewController];
self.window.rootViewController = initialVC;

If you know a priori the class you're instantiating

UITabBarController * initialVC = (UITabBarController *)[storyboard instantiateInitialViewController];
Gabriele Petronella
  • 104,800
  • 21
  • 210
  • 229