【发布时间】:2019-08-12 05:35:14
【问题描述】:
我在关闭 UIViewcontroller 时遇到问题,它是从 uiNavigationController 附加并打开的,当我关闭/重新打开 B UIViewcontroller 时,每次打开它时内存都会增加,但是当我关闭它时,内存不会发生任何事情下去 。
我试过以下代码都一样:
DispatchQueue.main.async {[weak self] in
guard let strongSelf = self else { return }
strongSelf.navigationController?.pushViewController(vc, animated: true)
}
和
DispatchQueue.main.async {[unowned self] in
self.navigationController?.pushViewController(vc, animated: true)
}
和
self.navigationController?.pushViewController(vc, animated: true)
B UIViewctonroller 在情节提要中只有一张图片,没有代码。
知道如何从内存中释放关闭的“pop” UIVIewcontroller 吗?
【问题讨论】:
-
请提供示例项目或更多代码,因为您的示例都做同样的事情,并且它们本身无法创建内存循环
-
如何获得 B UIViewController 在这里很重要。
标签: swift memory memory-leaks