title: didMoveToParentViewController and willMoveToParentViewController
body: <p>Apple Documentation on <code>UIViewController</code> says:</p>
  <p>If you are implementing your own container view controller, it must call the <code>willMoveToParentViewController:</code> method of the child view controller before calling the <code>removeFromParentViewController</code> method, passing in a parent value of nil.</p>
  <p>When your custom container calls the <code>addChildViewController:</code> method, it automatically calls the <code>willMoveToParentViewController</code>: method of the view controller to be added as a child before adding it.</p>
  <p>If you are implementing your own container view controller, it must call the <code>didMoveToParentViewController:</code> method of the child view controller after the transition to the new controller is complete or, if there is no transition, immediately after calling the <code>addChildViewController:</code> method.</p>
  <p>The <code>removeFromParentViewController</code> method automatically calls the <code>didMoveToParentViewController:</code> method of the child view controller after it removes the child.</p>
  <p>Why should I call these methods? What does those methods do?</p>
  <pre><code>ProfileViewController *profile = [[ProfileViewController alloc] init];
  profile.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
  [self addChildViewController:profile];
  [self.view addSubview:profile.view];
  [profile didMoveToParentViewController:self];
  </code></pre>
  <p>My code works perfectly even though I remove the last line. Can someone please help me in this?</p>
  <p>Thanks in advance</p>