ios - 从 Popover 关闭或弹出到 Root View Controller

标签 ios objective-c xcode uipopovercontroller

我的应用程序在单击弹出窗口中有一个注销按钮,我希望 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];
} 

enter image description here

enter image description here

最佳答案

此方法是使用协议(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/

相关文章:

ios - UITableView 从不调用 tableView :shouldShowMenuForRowAtIndexPath: on its delegate

ios - 从ios中的视频中获取所有帧

ios - 从 NSURLConnection POST 方法获取数据

iphone - 在 iTunesConnect 上添加应用程序购买只允许免费订阅

objective-c - strcpy 导致 EXC_BAD_ACCESS?

xcode - Cocoa 中的拖放 (<NSDraggingDestination>) 不起作用

ios - 如何在迦太基上安装旧版本

ios - 在 iPhone 中使用 Skydrive API 的注销问题

ios - FBSDKLoginManager : undefined symbols for architecture x86_64 + linker command failed with exit code 1

ios - iPad性能问题