0

test1 is the first view in the tarbarcontorller.. after I call presentViewController tab bar is missing How can i solve it??

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
TestTableViewController *TestTableViewController = [storyboard instantiateViewControllerWithIdentifier:@"test1"];
TestTableViewController.memberid = memberid;
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:TestTableViewController];
    [self.navigationController presentViewController:navigationController animated:YES completion:nil];
Jagat Dave
  • 1,643
  • 3
  • 23
  • 30
Waitak Jong
  • 87
  • 11

1 Answers1

0

You should present your TabBarController, and not the first view of your tab bar controller. It will display the first view in your tab bar controller properly.

Olivier
  • 118
  • 11
  • I would like to pass a var to the first viewcontorller. how can i do that?? – Waitak Jong Jun 07 '16 at 10:30
  • if i change the storyboard instantiateViewControllerWithIdentifier:@"test1"] to tarbarcontorller. TestTableViewController.memberid = memberid; <- crash. and also the navigation bar is mssing. – Waitak Jong Jun 07 '16 at 10:32
  • If you want to pass a variable to your next controller, use a segue. With TabBarController, it works [like this](http://stackoverflow.com/a/29573224/4020535). – Olivier Jun 07 '16 at 10:39