This is the code i have been using while i click the button there is no action occurs in my view controller.
 - (IBAction)controlleraction:(id)sender {
    ChildViewController *child=[[ChildViewController alloc]init];
   rootviewController *firstview= [[rootviewControllerone alloc]init];
    [self addChildViewController:child];
    child.view.frame = self.container.frame;//container is a container view (uiview)
    [self.container addSubview:child.view];
    [firstview removeFromParentViewController];
    [child didMoveToParentViewController:self];
         NSLog(@"working");
}
i have updated my code as per the suggestion and this code is not working for me .
 while i click the button the container view controller have to load in my container view.
while i click the button the container view controller have to load in my container view.
 
     
    