我在启动时成功显示了一个对用户进行身份验证的视图。成功后,我希望presentModalViewController不再可见并正确解除分配。
我的代码如下:
- (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;
}
答案 0 :(得分:8)
在你的模态视图控制器中,你需要一段代码:
[self dismissModalViewControllerAnimated:YES];