0

This is my window hierarchy

->Root view Controller
                    ->tableview
    -> child view controller 1

      ->child view controller 2

Image specification : enter image description here

enter image description here

first image **Rootview** controller ,second image is child view controller placed ,because of child view my root view controller has been hidden ,how i have to make the **tableview** as super view.

In root view controller i have **tableview** when user clicks navigation bar button i need to show it on above two child view controller is it possible ?

This is my code its presents on RootViewController

- (IBAction)tableviewapicall:(id)sender
{
    if(tableviewbool)
    {
        _tableview.hidden=NO;
        tableviewbool=NO;
        [_tableview superview];
    }
    else
    {
        _tableview.hidden=YES;
        tableviewbool=YES;
    }
}

Please help me to do that friends:)

Ketan P
  • 4,259
  • 3
  • 30
  • 36
Kishore Kumar
  • 4,265
  • 3
  • 26
  • 47

1 Answers1

1

To implement this Simply try this steps:

First give tag to both Child view controller View.

Let say if you have child view controller in Storyboard or xib than just give unique tag to it.

If you have created child view controller programmatically than assign tag programmatically there.

Now simply do this:

- (IBAction)tableviewapicall:(id)sender {
    if(tableviewbool) {
        _tableview.hidden=NO;
        tableviewbool=NO;
        [_tableview superview];
        // Get both Child view controller view by tag Hide it
    } else {
        _tableview.hidden=YES;
        tableviewbool=YES;
        // Get both Child view controller view by tag Show it
    }
}

Hope it will help you.

Mayur Prajapati
  • 5,454
  • 7
  • 41
  • 70
  • in my method i need to display home screen don't want to hide ,if i have that option then your idea will be correct :). – Kishore Kumar Feb 10 '16 at 05:36