我有一个 MainWindowController,我想在“触摸内部”按钮事件时关闭它并打开一个新的 UIView。 我使用的代码是这样的:
NewViewController *controller = [[NewViewController alloc]
initWithNibName:@"NewView" bundle:nil];
controller.delegate = self;
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:YES];
[controller release];
但是这样 MainWindowController 不会自行关闭。
最佳答案
试试这个
[self dismissViewControllerAnimated:YES completion:nil];
关于iphone - 如何关闭 UIVIewController?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4990505/