Issue:

I have three View Controller class and also have one navigation Controller . I have push from second view controller class to third view controller class and when back form third view controller that time it is every time pop to second view controller class.
I want to directly pop to first view controller class and not redirect to second controller class.

To overcome this issue I have implement below steps and code :

1. Push from first view controller to second view controller.

//Write your code here

2. When you push from second view controller to third view controller that time first push view controller and then write line [self removeFromParentViewController] as described below:

//Write your code here for initialize the third view controller and load nib from bundle and then follow the below code.

[navigationController pushViewController:objViewController animated:YES];
[self removeFromParentViewController];

3. When you pop form third view controller then you directly switching on first view controller.
// Write your code here

You may also like

Leave a Reply