I need to dismiss the two modal view controllers, I know how to pop two or more view controllers
UINavigationController* navController = self.navigationController;
NSArray *array=[navController viewControllers];
UIViewController* controller = [navController.viewControllers objectAtIndex:0];
[navController popToViiewController:controller animated:YES];
This is how i can navigate back to my first view but if there are two or more dismiss modal view then how can i navigate back
please help me,
Thank you,
Madan Mohan
if you set the object at index 0 in the above code its gonna take you to first view which is a push view controller.
1)Rootview—>moodalview1—>moodalview2—>moodalview3 if you use above code then you wiil be in root view.
2)Rootview—>Pushview1—->moodalview1—>moodalview2—–>moodalview3. if you use above code you will be in the PushView.