【发布时间】:2016-03-08 18:26:04
【问题描述】:
当用户点击按钮时,我会显示UIViewController,如下所示:
NSString * storyboardName = @"Main";
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle: nil];
UIViewController * vc = [storyboard instantiateViewControllerWithIdentifier:@"newviews"];
[self presentViewController:vc animated:YES completion:nil];
然而,当vc viewcontroller 加载成功时,用户将点击另一个按钮并显示另一个UIViewcontroller。同样,这也使用了presentViewController:,就像之前的代码一样。
现在,presentViewController: 正在显示 2 个UIViewController,
当用户点击一个按钮时,我需要这 2 个 ViewController 来关闭。我该怎么做?
我尝试了以下代码,但没有成功。
[self.navigationController popToRootViewControllerAnimated:YES];
【问题讨论】:
标签: ios objective-c iphone uiviewcontroller