0

I took 2 UIViewController HomeView and ViewMyStuff in Storyboard.

I am adding ViewMyStuff Controller in HomeView. In HomeView's ViewDidLoad, written below in my code.

- (void)viewDidLoad
{
    ViewMyStuff *vwMyStuff = [self.storyboard   instantiateViewControllerWithIdentifier:@"viewreportvc"];
    [self addChildViewController: vwMyStuff];
    [vwMyStuff didMoveToParentViewController:self];
}

vwMyStuff controller is not added in HomeViewController. Is there anything I missing? Please help

Thanks.

vegda neel
  • 154
  • 12

1 Answers1

0

You need to add subView of your ViewMyStuff *vwMyStuff viewController.

- (void)viewDidLoad
    {
        ViewMyStuff *vwMyStuff = [self.storyboard   instantiateViewControllerWithIdentifier:@"viewreportvc"];
        [self addChildViewController: vwMyStuff];
        [vwMyStuff didMoveToParentViewController: self];
        [self.view addSubview:vwMyStuff.view];
    }

Hope it works for you!!

Ravi B
  • 1,574
  • 2
  • 14
  • 31