[objective-c]UINavigationController UIViewController 困难

发布时间: 2016/10/4 7:17:45
注意事项: 本文中文内容可能为机器翻译,如要查看英文原文请点击上面连接.

如何将其转换为 UIViewController 才有可能︰

for (UIViewController *tmpController  in [self.navigationController viewControllers]) 
{
    if ([tmpController isKindOfClass:[RootViewController class]])
    {
        [self.navigationController popToViewController:tmpController animated:YES];
        break;
    }
}

[self.navigationController viewControllers]--> 如何将其转换为 UIViewController ,因为我有错误,

[self.navigationController popToViewController:tmpController animated:YES];而它像转换这--> 这部分-->[self dismissModalViewControllerAnimated:YES];

解决方法 1:

如果你已经提出了一种 ViewController B,提出了一种 ViewController C 的 ViewController A

你想要去回到 A,执行以下操作,在 viewController C

[self dismissModalViewControllerAnimated:NO];
[[self presentingViewController] dismissModalViewControllerAnimated:NO];
赞助商