What I want to do is to have my table view controller appear when the user presses a tab bar item, and when the user presses a cell in the table I want to switch to a nav controller while retaining the tab bar controller.
So far I’ve been testing my table view in my tab bar controller with a test UIViewController class and trying to switch to that.
I’ve added the following to my table view delegate method:
test *newTest = [[test alloc] init];
[self.view insertSubview:newTest.view atIndex:0];
It just overlaps the nib onto what I already have. I suspect I must clear my existing table view? Also, can I use this method with a UINavigationController?
I would like to add that initially I had a navigation controller with the table controllers within. However, the first table controller I did not want the top navigation bar. I only wanted a top bar until the person drilled down to the second level.
Put your table VC back in your navigation stack as the root controller, but add these lines to have the navigation bar hide:
You may need to put one or the other of these in the
viewDidAppear:/viewDidDisappear:methods if the animation looks awkward or happens at the wrong time.Also, as far as showing/hiding the tab bar goes, check out the
hidesBottomBarWhenPushedfield onUIViewController.