casillas
casillas

Reputation: 16813

PushViewController iOS

I have three view controllers. MainViewController, secondViewController, thirdViewController. I would like to know once I click on done button on the thirdViewcontroller,

How could I go directly yo MainViewController instead of going back secondViewController and then MainViewcontroller by using pushViewController?

Upvotes: 0

Views: 887

Answers (1)

SethHB
SethHB

Reputation: 743

Assuming that your using a navigation controller, you can pop to root by calling:

[[self navigationController] popToRootViewControllerAnimated:YES];

This will bring you back to your MainViewController.

Upvotes: 4

Related Questions