简体   繁体   中英

UISearchController does not get released from memory when Active

I have a UISearchController in my application which is active. Now the ParentController which is showing the search controller gets popped from button action inside the controller.

Now what is happening is that the due to this search controller, the parent controller is not getting released from the memory. Any suggestions how to handle this scenario

I have to set self.searchController.active = false; everytime i have to pop.

Usual scenario is where a child VC has an unneeded reference to the parent and does not specify this to be weak. Therefore, a retain cycle appears where the parent retains the child and the child retains the parent so none of them are actually released.

This might be your case as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM