i am new to iOS programming. i really need your help.
i have a login screen that takes me to a map (google API). on clicking any created annotation i want to load a tabbar with 2 views.
i searched and found out that i need to add the tabbar at the starting ie the appdelegate and show/hide the tabbar when needed.
so i made 2 functions to show and hide tabbar as
-(void)Load_tabBar{
[self.navigationController.view removeFromSuperview];
[self.window addSubview:tabBarController.view];
[self.window makeKeyWindow];}
-(void)remove_tabBar{
self.tabBarController.selectedIndex=0;
[self.tabBarController.view removeFromSuperview];
[self.window addSubview:navigationController.view];
[self.window makeKeyWindow];}
it did work when i call the Load_tabBar method and when i click back it calls remove_tabBar method. if i again call Load_tabBar method and back, it crashes giving error
-[UILayoutContainerView window]: message sent to deallocated instance 0x563b0b0
edited: PS : can i add tabbar view to a view controller and then push that view?
thnx