我有一个嵌入 UINavigationController 中的 UITableViewController。在 didSelectRowAtIndexPath 方法中调用 self.navigationController popViewControllerAnimated:YES 没有任何效果。
我的 Main.storyboard 看起来像:UIViewController -> UINavigationController -> UITableViewController。如何返回到 UIViewController 点击 UITableViewCell ?
最佳答案
popViewController
从 navigationViewController 堆栈中消除 1 个 viewController。由于您的 tableViewController 是此堆栈中唯一的 viewController,因此弹出它不会执行任何操作。
您想要做的是关闭您的 navigationController,它很可能以模态方式呈现。您可以通过调用 dismissViewControllerAnimated
关于ios - popViewController 在 UITableViewController 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37363812/