views:

32

answers:

1

I'm attempting to create an application that has a regular view shown on start-up. It acts as a introduction view with two buttons that give the user choices to sign or register. After clicking sign in I present the form with presentModalViewController. After they finish with this I want to dismiss the modal view, and swap the introduction view with a tab bar controller that is the regular application.

I'm having a lot of trouble getting this to happen animated though. I did manage to get the modal view to transition out with the new view below it, but then immediately the introduction view is reshown, and I'm not sure why.

In the delegate I'm running this:

[window addSubview:firstRunController.view];

Presenting the view is very standard

This is how i'm dismissing it and getting the behavior I said above:

QuestionMeAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[self dismissModalViewControllerAnimated:YES];
[delegate.firstRunController.view removeFromSuperview];
A: 

If you maintain views by navigationController, you can assign view controllers by - (void)setViewControllers:(NSArray *)viewControllers animated:(BOOL)animated.

I did swap views by re-assigning view controllers of navigation controller first, and then call dismissModelViewController to leave current view controller or navigation view controller.

Toro