title: Children view controllers must have a common parent view controller?
body: <p>In my app I am attempting to switch views which each is their own XIB while using custom animations to do so. I made a base view controller as a parent view to hold all the code but I just can't seem to get this to work. </p>
  
  <p>I made an IBOutlet for all of the view controllers in my app and in interface builder, I connect the outlets to the proper controller. Each controller loads the proper XIB too so none of that is the issue. The issue is the following changing views code.</p>
  
  <p>This is my code:</p>
  
  <pre><code>-(void)changeViews {
      CGRect frame = self.view.frame;
      frame.origin.x = CGRectGetMaxX(frame);
      theView4.view.frame = frame;
  
      [self.view addSubview:theView4.view];
      [self addChildViewController:theView4];
  
      [self transitionFromViewController:theView1 
                        toViewController:theView4 
                                duration:1 
                                 options:UIViewAnimationOptionTransitionNone
                              animations: ^{
                                  CGRect frame = self.view.frame;
                                  theView4.view.frame = frame;
                                  frame.origin.x -= frame.size.width;
                                  self.view.frame = frame;
                              }
                              completion:completion:nil];
  </code></pre>
  
  <p>And this is the console crash:</p>
  
  <pre><code>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Children view controllers &lt;MyGameViewController: 0x1dd25210&gt; and &lt;Settings: 0x1dd249d0&gt; must have a common parent view controller when calling -[UIViewController transitionFromViewController:toViewController:duration:options:animations:completion:]'
  </code></pre>
  
  <p>Does anyone know how to fix this?</p>
  
  <p>Thanks!</p>