I have 3 views.
I want to do the following:
A presents B modally
A dismisses B
A presents C modally
I have setup a delegate pattern where A is B's delegate. This is how I am presenting and dismissing in B:
[delegate dismissB]; //this is just [self dismissModalViewControllerAnimated:NO]
[delegate presentC]; //this is just [self presentModalViewController:c animated:NO];
For some reason my app crashes when I execute this code with no debugger results (I have NSZombieEnabled).
When I comment out [delegate presentC]
the app will dismiss B properly. When I comment out [delegate dismissB]
the app does nothing, even though the line executes. I am not sure why?
UPDATE: Here is the code in A
-(void)showARView{
[self dismissModalViewControllerAnimated:NO];
ARViewController* arViewController = [[[ARViewController alloc] initWithNibName:@"ARViewController" bundle:nil]autorelease];
UINavigationController *arNavController = [[UINavigationController alloc] initWithRootViewController:arViewController];
LeaderBoardTableViewController* lbViewController = [[[LeaderBoardTableViewController alloc] initWithNibName:@"LeaderBoardTableViewController" bundle:nil]autorelease];
lbViewController.title = @"Leaderboard";
UINavigationController *lbNavController = [[UINavigationController alloc] initWithRootViewController:lbViewController];
arTabBarController = [[UITabBarController alloc] init];//initWithNibName:nil bundle:nil];
arTabBarController.delegate = self;
arTabBarController.viewControllers = [NSArray arrayWithObjects:arNavController, lbNavController, nil];
arTabBarController.selectedViewController = arNavController;
[arNavController release];
[lbNavController release];
[self presentModalViewController:arTabBarController animated:NO];
}
Here is the code in B
[delegate showARView];