Apologies if this question reveals the big holes in my knowledge.
如果这个问题揭示了我的知识中的大漏洞,请道歉。
I am using setRootViewController to switch views because I need to use a SplitViewController. When I go back to the front screen using setRootViewController will the OS/Compiler automatically remove the previous RootViewController from memory in dealloc, or do I need to do that in my goBack function?
我正在使用setRootViewController来切换视图,因为我需要使用SplitViewController。当我使用setRootViewController返回到前面的屏幕时,OS /编译器会自动从dealloc中的内存中删除以前的RootViewController,还是我需要在goBack函数中执行此操作?
1 个解决方案
#1
3
Yes, because there can be only one root view controller per window, and because the window retains it. When a new view controller is assigned as root, it is retained and the old one is released.
是的,因为每个窗口只能有一个根视图控制器,因为窗口会保留它。将新视图控制器指定为root时,将保留该视图控制器并释放旧视图控制器。
#1
3
Yes, because there can be only one root view controller per window, and because the window retains it. When a new view controller is assigned as root, it is retained and the old one is released.
是的,因为每个窗口只能有一个根视图控制器,因为窗口会保留它。将新视图控制器指定为root时,将保留该视图控制器并释放旧视图控制器。