开发者

Most Elegant way to dismiss a presentModalViewController?

开发者 https://www.devze.com 2023-02-27 02:41 出处:网络
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.

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]开发者_如何学JAVA;
    [self.tabBarController presentModalViewController:overview animated:YES];
    [overview release];
    [self.window makeKeyAndVisible];

    return YES;
}


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

[self dismissModalViewControllerAnimated:YES];
0

精彩评论

暂无评论...
验证码 换一张
取 消