UISearchController is not freed from memory when Active

I have UISearchControllerin my application that is active. Now the ParentController, which shows the search controller, appears from the button action inside the controller.

Now what happens is that because of this search controller, the parent controller is not freed from memory. Any suggestions on how to handle this scenario

I need to install self.searchController.active = false;every time I need pop.

+4
source share
1 answer

The usual scenario is where the child VC has an unnecessary reference to the parent and does not indicate that it is weak. Therefore, the save cycle appears when the parent saves the child, and the child saves the parent, so none of them are freed.

This may be your case.

0
source

Source: https://habr.com/ru/post/1653215/


All Articles