I have three UIViewControllers: MainViewController, CurledViewController and SecondayViewController.
On MainViewController I have one UIButton in the MainViewController that displays the CurledViewController through:
curled = [[CurledViewController alloc] init];
[curled setModalTransitionStyle:UIModalTransitionStylePartialCurl];
[self presentModalViewController:curled animated:YES];
From the documentation I am told:
A modal view presented using this transition is itself prevented from presenting any additional modal views.
Which prevents me from opening the SecondaryViewController when the CurledViewController is displayed in this way. What I would like to do is, on the selection of a UIButton in CurledViewController, close the curl and open the SecondaryViewController (whether it's a call from CurledViewController or MainViewController doesn't matter). Upon closing SecondaryViewController, I would like CurledViewController to be re-opened.
In the function attached to the UIButton in CurledViewController I have attempted this through:
- (void)showSecondary:(UIButton *)sender {
[self.parentViewController dismissModalViewControllerAnimated:YES];
SecondaryViewController *secondaryView = [[SecondaryViewController alloc] initWithNibName:@"Secondary" bundle:Nil];
[self presentModalViewController:secondaryView animated:YES];
...
}
but am still told,
Application tried to present a nested modal view controller while curled
How do I go about opening a new UIViewController in this fashion?
Thanks!