i get this error in the console after i push the button.
Unbalanced calls to begin/end appearance transitions for < UITabBarController: 0xcb3a330 >.
my code is
-(IBAction)push:(id) sender {
UITabBarController *tabbar1 = [[UITabBarController alloc] init];
firstViewController *first = [[firstViewController alloc] initWithNibName:@"firstViewController" bundle:nil];
UINavigationController *tabItem1 = [[UINavigationController alloc] initWithRootViewController: first];
secondViewController *second = [[secondViewController alloc] initWithNibName:@"secondViewController" bundle:nil];
UINavigationController *tabItem2 = [[UINavigationController alloc] initWithRootViewController: second];
tabbar1.viewControllers = [NSArray arrayWithObjects:tabItem1, tabItem2,nil];
[self.view insertSubview:tabbar1.view belowSubview: first.view];
[self presentModalViewController:tabbar1 animated:YES];}
the fisrtViewController is UITableViewController
i tried to set the self to [self.tabBarController presentModalViewController:tabbar1 animated:YES];
but still the same
any idea ?
UPDATE :
i found the solution , i just deleted this line of code
[self.view insertSubview:tabbar1.view belowSubview: first.view];
and everything went just fine 🙂
The code
[self.view insertSubview:tabbar1.view belowSubview: first.view];has no significance. Because, the the objectfirstis no longer loaded. Therefor that statement is invalid. Remove that code and go on.