-(void)backAction:(id)sender
{
SecondViewController *viewCtrl = [[SecondViewController alloc] init];
[self.presentingViewController dismissModalViewControllerAnimated:NO];
[self.presentingViewController presentModalViewController:viewCtrl animated:YES];
}
I want to dismissModalViewControllerAnimated the current controller,then present a new controller. But it only dismissModalViewControllerAnimated:NO.
why?
In this line, you are already dismissing the view controller
Then in the next line you are trying to preset a modal view using the view controller that was already dismissed.
Instead try presenting the modal view using a the parent view controller (if you have any) of both these views. You can also fire a notification to your parent view controller after dismissing the first view so that you can launch the second modal view from the parent view controller.