tabbar memory management

前端 未结 3 1129
误落风尘
误落风尘 2021-01-16 07:22

a tab bar based app with 5 tabs switching option...how i am suppose to manage memory efficiently?

switching between tab are very frequent i am how to manage this sce

3条回答
  •  梦谈多话
    2021-01-16 07:57

    All View Controllers associated with a Tab Bar Controller are retained by the tab bar controller, but if you're using intense amounts of memory, you can release objects or resources used by your view controller when viewWillDisappear: or viewDidDisappear: gets called. And recreate / reallocate those memory hogging objects when viewWillAppear: or viewDidAppear: get called when the user clicks it into view again.

提交回复
热议问题