从Popover中关闭或弹出到根视图控制器

时间:2014-09-06 06:19:53

标签: ios objective-c xcode uipopovercontroller

我的应用程序在弹出时有一个注销按钮单击我希望视图控制器(不是弹出控制器)转到根视图控制器。我创建了Protocol并从pop over(MyPopoverViewController)到MyMainViewController调用一个方法。一切正常。但是当我使用pop到root视图控制器时使用popToView控制器代码doenst有任何影响。

-(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

1 个答案:

答案 0 :(得分:1)

使用Protocol

从pop over view controller调用此方法
-(void)LogOut
{
    NSLog(@"LogOut");
    [self dismissViewControllerAnimated:YES completion:^{
        [self.navigationController popToRootViewControllerAnimated:YES];
    }];

}
相关问题