Unbalanced calls to begin/end appearance transitions for <ViewController>,<Tab>

Posted by onkar on Stack Overflow See other posts from Stack Overflow or by onkar
Published on 2012-12-06T04:34:48Z Indexed on 2012/12/06 5:04 UTC
Read the original article Hit count: 372

Filed under:
|
|

I am trying to implement Tabs into my secondView.On button touch(from ViewController.m) I am navigating to secondView(Tabs). In my Tabs.xib file I have added a TabBar at bottom and it is custom class of UITabBar.

ViewController.m

- (IBAction)touchedInside:(id)sender {
    NSLog(@"touhced up inside");

    Tabs *temp = [[Tabs alloc]initWithNibName:@"Tabs" bundle:nil];
    [self.navigationController pushViewController:temp animated:YES];
    [self presentViewController:temp animated:YES completion:nil];


}

Tabs.m

- (void)viewDidLoad
{
    [super viewDidLoad];

     AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    UITabBarController *tabBarController = [[UITabBarController alloc]init];
   /* 
    Tab_1 *firstView = [[Tab_1 alloc] init];
    UITabBarItem *item1 = [[UITabBarItem alloc]initWithTitle:@"First" image:nil tag:1];
    [firstView setTabBarItem:item1];
    NSLog(@"after first tab is added");
    Tab_2 *secondView = [[Tab_2 alloc] init];
    UITabBarItem *item2 = [[UITabBarItem alloc]initWithTitle:@"Sec" image:nil tag:1] ;
    [secondView setTabBarItem:item2];
     NSLog(@"after second tab is added");
    [tabBarController setViewControllers:[NSArray arrayWithObjects:firstView,secondView,nil] animated:NO];
     NSLog(@"after tab is added");
    [appDelegate.window  addSubview:tabBarController.view];
    NSLog(@"after view is added");
   */
    appDelegate.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    UIViewController *viewController1 = [[Tab_1 alloc] initWithNibName:@"Tab 1" bundle:nil];
    UIViewController *viewController2 = [[Tab_2 alloc] initWithNibName:@"Tab 2" bundle:nil];
    UIViewController *viewController3 = [[Tab_2 alloc] initWithNibName:@"Tab 1" bundle:nil];

    tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, viewController3, nil];
    appDelegate.window.rootViewController = self.tabBarController;
    [appDelegate.window makeKeyAndVisible];
    Tabs *temp = [[Tabs alloc]initWithNibName:@"Tabs" bundle:nil];
    [self.navigationController presentModalViewController:temp animated:NO];

}

Errors

Unbalanced calls to begin/end appearance transitions for <ViewController: 0x6833c80>.
2012-12-06 09:57:48.963 demoTabs[667:f803] Unbalanced calls to begin/end appearance transitions for <Tabs: 0x6a3fc90>.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c