I have an application that shows a presentModalViewController upon launch.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// Add the tab bar controller's view to the window and display.
[self.window addSubview:tabBarController.view];
Overview *overviewViewController = [[Overview alloc] initWithNibName:@"Overview" bundle:nil];
[self.tabBarController presentModalViewController:overviewViewController animated:YES];
[overviewViewController release];
[self.window makeKeyAndVisible];
return YES;
}
Once the overviewController is shown, the user gets to log in or register. If they select login, then I am using another presentModalViewController that lets them log in:
-(IBAction) btnLoginPressed{
// [self dismissModalViewControllerAnimated:YES];
Login *loginOverView = [[Login alloc] initWithNibName:@"Login" bundle:nil];
[self presentModalViewController:loginOverView animated:YES];
[loginOverView release];
}
However on a successful login, I want both the presentModalViewController to disappear allowing me to get back to the root controller which is a tab bar controller.
I have tried to do the following but it does not work:
-(IBAction) btnSubmitLoginPassword{
//make web service call
// [self dismissModalViewControllerAnimated:YES];
[self.tabBarController dismissModalViewControllerAnimated:YES];
}
Now in my Googling, I have come across the concept of delegates which I am not familiar with. Can someone take the time to help me in my dilemma.
Thanks in advance