2014-03-24 155 views
0

要獲得模態賽格上的導航控制器,我想我會嘗試創建層次結構,如在屏幕截圖中所示。另一個導航控制器上的流行導航控制器

此插座退出模式(登錄信息視圖控制器)的正確方法是什麼?

我嘗試了一些不同的東西:

- (IBAction)goBack:(id)sender 
{ 
    //none of these works.. (only tried one at a time..) 
    [self.navigationController removeFromParentViewController]; 
    [self.navigationController popViewControllerAnimated:YES]; 
    [self.navigationController.navigationController popViewControllerAnimated:YES]; 
} 

enter image description here

enter image description here

回答

1

在點你想關閉該模式的viewController,在類中使用這行:

[self dismissViewControllerAnimated:YES completion:^{ 
}]; 

因此,在你的情況下,它變成:

- (IBAction)goBack:(id)sender 
{ 
    [self dismissViewControllerAnimated:YES completion:^{ 
    }]; 
}