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
[self.navigationController popToRootViewControllerAnimated:YES];
instead of your way, which is a bit faffy. – Ambrosia