我想知道 self.navigationController?.popViewController(animated: true)
是否真的关闭了正在调用它的 View Controller ,或者它是否只是返回到之前的 View Controller ?如果是这样,这是否意味着我必须在使用上述代码的同时手动关闭 View Controller?谢谢。
最佳答案
当您从 UINavigationController 的导航堆栈中弹出 View Controller 时,UINavigationController 释放弹出的 View Controller ,默认情况下它不存在。您可以通过实现该 View Controller 的 deinit
来看到这一点。
如果您没有看到 deinit
被调用,那么该 View Controller 正在泄漏,因为您有一个保留周期,您需要担心为什么会这样。
关于ios - 使用 `self.navigationController?.popViewController(animated: true)` 是关闭当前的 ViewController 还是只是返回到前一个?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42748989/