如何取消初始化嵌入在TabBarController中的ViewController [Swift 5]

时间:2019-05-20 17:51:05

标签: swift automatic-ref-counting deinit

我在TabBarController中封装并实例化了两个ViewController。 TabBarController在上级NavigationController中实例化。

当NavigationController决定返回并“离开” TabBarController及其两个ViewController时,NavigationController将取消初始化TabBarController。 TabBarController的deinit方法被调用。但是我注意到,没有调用我的两个ViewController的deinit方法。

问题

怎么可能可以释放TabBarController但不能释放嵌入式ViewController? ARC在这种情况下如何工作?如何强制对嵌入式ViewController进行deinit调用?

0 个答案:

没有答案