Reputation: 166
When I init UITabBarController
where each tab include UINavigationController
and each UINavigationController
include UIViewController
when in UIViewController
I do something like
TSActivityDetailsVC * c = [[TSActivityDetailsVC alloc] initWithNibName:@"TSActivityDetailsVC" bundle:nil];
[self.navigationController pushViewController:c animated:YES];
I have animation, but when I press back button - I not have animation and get error
Log:
push view controller
Unbalanced calls to begin/end appearance transitions for <TSActivityMapVC: 0x81b1000>.
back btn pressed
Unbalanced calls to begin/end appearance transitions for <TSActivityDetailsVC: 0x81c85d0>.
init code:
-(UITabBarController *) createMainTabBarController{
UITabBarController * tabbarCntr = [[UITabBarController alloc] init];
[tabbarCntr setViewControllers:[NSArray arrayWithObjects:
[[UINavigationController alloc] initWithRootViewController:[[TSActivityMapVC alloc] init]],
[[UIViewController alloc] init],
[[UIViewController alloc] init],
[[UIViewController alloc] init],
[[UIViewController alloc] init]
, nil]];
[tabbarCntr.tabBar setSelectionIndicatorImage:[UIImage imageNamed:@"selection_indicator"]];
[tabbarCntr.tabBar setBackgroundImage:[UIImage imageNamed:@"tabbar_background"]];
return tabbarCntr;
}
in TSActivityMapVC
I perfom
TSActivityDetailsVC * c = [[TSActivityDetailsVC alloc] initWithNibName:@"TSActivityDetailsVC" bundle:nil];
[self.navigationController pushViewController:c animated:YES];
surprisingly that when I go to another tab and return - after it - all works fine without errors
Upvotes: 3
Views: 2451
Reputation: 1503
I got the solution! I subclasses the UITabBarController
and forgot to call the super of viewWillAppear
. So the transition animation of the UITabBarController
not finished.
This caused the the "Unbalanced calls to begin/end appearance"!
Upvotes: 10
Reputation: 7241
Finally I've reproduced your error. It seems that you are forgotten to call super in both methods.
-(void)beginAppearanceTransition:(BOOL)isAppearing animated:(BOOL)animated{
[super beginAppearanceTransition:isAppearing animated:animated];
NSLog(@"**************begin app tr");
}
-(void)endAppearanceTransition{
[super endAppearanceTransition];
NSLog(@"**************end app tr");
}
Hope your issue in this.
Upvotes: 1