首页 > 解决方案 > ViewController 未从内存中释放

问题描述

我有这个视图层次结构

目前,RouterDashboardViewController 实例位于导航堆栈中。当我重置 NavigationController 的 rootViewController 时,RouerDashboardInstance 仍然存在于内存中,因为我可以检查我的deinit{}方法没有被调用。下面是 Instruments 中的堆栈跟踪,但无法检测到我的 RouterDashboard 实例没有被释放的任何原因。我确信会有保留周期使 RouterDashboard 实例仍然存在。另一件事是不理解这些堆栈跟踪,因为 ViewDidLoad() 方法调用了多次。仪器的堆栈跟踪

标签: iosswiftmemory-leaksautomatic-ref-countingretain-cycle

解决方案



推荐阅读