我的应用程序在单击弹出窗口中有一个注销按钮,我希望 View Controller (而不是弹出 Controller )转到 Root View Controller 。我创建了协议(protocol)并调用从 pop over (MyPopoverViewController) 到 MyMainViewController 的方法。一切正常。但是当我使用 popToView Controller 使用 pop 到 Root View Controller 时代码确实有任何影响。
-(void)LogOut
{
NSLog(@"This method is called from pop over view controller using Protocol");
[self.navigationController popToRootViewControllerAnimated:NO];
}
最佳答案
此方法是使用协议(protocol)从弹出 View Controller 调用的
-(void)LogOut
{
NSLog(@"LogOut");
[self dismissViewControllerAnimated:YES completion:^{
[self.navigationController popToRootViewControllerAnimated:YES];
}];
}
关于ios - 从 Popover 关闭或弹出到 Root View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25697474/