title: Popping to a specific viewcontroller in a navigation stack
body: <p>I have a come across a piece of code to pop to a specific viewcontroller in a navigation stack as below</p>
  
  <pre><code>for (UIViewController* viewController in self.navigationController.viewControllers) {
      if ([viewController isKindOfClass:[MyGroupViewController class]] ) {
          MyGroupViewController *groupViewController = (MyGroupViewController*)viewController;
          [self.navigationController popToViewController:groupViewController animated:YES];
      }
  }
  </code></pre>
  
  <p>The objective is to pop to MyGroupViewController. But I am not understanding this line of code.</p>
  
  <pre><code>MyGroupViewController *groupViewController = (MyGroupViewController*)viewController;
  </code></pre>
  
  <p>Whats exactly happening here. I don't think a new instance of MyGroupViewController is being created here.</p>