Changing the root view controller is not deallocating the previous view controllers on the same window

后端 未结 1 835
南旧
南旧 2021-02-14 06:38

My app launches with an initial view controller (lets call it as StartVC). Now when user presses a continue button, I am presenting a navigation stack (lets call it as

相关标签:
1条回答
  • 2021-02-14 07:37

    I think the rootViewController setting is not the problem. Perhaps you have a retain cycle in your other view controllers that stops them from being deallocated.

    There are many ways you could accidentally do this (capturing strong references to self in blocks, not marking delegates or other back references as weak, etc).

    You might be able to figure it out with Instruments. Here's a tutorial: http://samwize.com/2016/05/30/finding-retain-cycle-with-instruments/

    0 讨论(0)
提交回复
热议问题