When I click the tab bar that holds my kal calendar the calendar disappears:

This is my code in viewWillAppear:
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
KalViewController *calendar = [[KalViewController alloc] init];
[self.navigationController pushViewController:calendar animated:YES];
calendar.dataSource = self;
calendar.delegate = self;
[calendar reloadData];
self.tabBarController.delegate = self;
}
I also have this method:
-(void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
[self viewWillAppear:YES];
//Even when I comment out this line the problem stays!
}
If you need more infomation just ask.
EDIT:

You are using your tab bar controller improperly. Indeed, you should populate it with your controllers (either in Interface Builder or by setting the tab bar controller's
controllersproperty) and let it do its job.On another coin, note that
viewWillAppearcan be called multiple times, so this is the last place where you want to allocate a new controller. If you have overriddenviewWillAppearin order for your controller to show something when it s view is displayed that is not the correct approach.EDIT:
If you create your UI programmatically, these are the steps you should follow in you
application:didFinishLaunching:to setup the rootViewController:If you build your UI in Interface Builder, you will do the same graphically, but I cannot reproduce it here.
In any case, I hope this snippet clarifies the way the tab bar controller works: you instantiate all of its controllers, put them in an array, pass the array to the tab bar controller. No need to instantiate anymore the tabbed controllers (neither in viewWillAppear nor in viewDidLoad)...