Strong Like Bull
Strong Like Bull

Reputation: 11297

Most Elegant way to dismiss a presentModalViewController?

I have successfully shown a view upon launch that authenticates a user. Upon success, I want the presentModalViewController to no longer be visible and deallocate properly.

My code is as follows:

- (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 *overview = [[Overview alloc] initWithNibName:@"Overview" bundle:nil];
    [self.tabBarController presentModalViewController:overview animated:YES];
    [overview release];
    [self.window makeKeyAndVisible];

    return YES;
}

Upvotes: 1

Views: 2757

Answers (1)

Joris
Joris

Reputation: 6286

In your modal viewcontroller you need a piece of code doing:

[self dismissModalViewControllerAnimated:YES];

Upvotes: 7

Related Questions