0

I have a Tab Bar application coded in Objective-c. One of the tabviews I have is a TableView. What I'm trying to do is, when a cell of this TableView is selected, the app takes the user to another view, but this view isn't on the tab menu, and I don't want to lose the tab menu when this view appears.

Is it possible to do it? How? Couldn't find much on the web.

Fred Novack
  • 727
  • 9
  • 27

2 Answers2

1

Just embed navigation controller to that tab's viewcontroller which have tableview.

so your viewhierarchy should be like tabbar controller - navigation controller - viewcontroller (tab) - detailviewcontroller

you can embed navigation controller by selecting viewcontroller, then from menu select editor then embed in then navigation controller.

Hope this will help :)

Ketan Parmar
  • 27,092
  • 9
  • 50
  • 75
  • How do I link the viewcontroller(tab) to detailviewcontroller? I clicked on the viewcontroller(tab) held "control"dragged to the detailviewcontroller and selected (show detail) but it replaced the entire tabbar – Fred Novack May 31 '16 at 13:42
  • I did it! instead of selecting "show detail"you have to select "show"" Thanks for the help! – Fred Novack May 31 '16 at 13:57
0

If you are having the single View Controller to show then you can try doing this by adding the new view controller's view as subView to the current view controller's view

Eg:

newVC.view.frame = self.view.frame;
newVC.view.frame.size.height = self.view.frame.size.height - HEIGHT_OF_TAB_BAR;
[self.view addSubview:newVC.view];

If there are more View Controller's that are adding further then using the navigation controller under tab bar controller will also work.

Refer: How to implement tab bar controller with navigation controller in right way

Community
  • 1
  • 1
Suhas Arvind Patil
  • 1,732
  • 1
  • 19
  • 31