关闭presentModalViewController最优雅的方法?
我已经成功地在启动时显示了一个对用户进行身份验证的视图。成功后,我希望 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;
}
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;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在模态视图控制器中,您需要一段代码执行以下操作:
In your modal viewcontroller you need a piece of code doing: