iosuiviewcontrolleruistoryboardxcode4.5poptoviewcontroller

PopToViewController in UIStoryboard application


I have made on application using Xcode 4.5. and also use UIStoryboard in this application.

In this app, I push from one ViewController to second ViewController and then push from second ViewController to third ViewController.

Now, How I can Pop (back) directly from third ViewController to first ViewController.

Is it possible or not ? If possible, then How?


Solution

  • This is possible , Just use this..

      [self.navigationController popToViewController: [self.navigationController.viewControllers objectAtIndex:0] animated:YES];
    

    You can change value of objectAtIndex with any controller's value you want to pop