Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why: "Attempting to load .. while deallocating... :UISearchController:"

I have root storyboard that has a button that pushes ViewControllerB.

ViewControllerB has a sort controller UISortController.

ViewControllerB has a "back" method that is controlled by the root nav controller.

I'm getting the following warning:

Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior (<UISearchController: 0x7ff10258ba60>)

I used Apple's sample (membership required) to add the new UISearchController.

Has anyone come across this? How do I resolve it?

like image 374
ICL1901 Avatar asked Oct 30 '22 22:10

ICL1901


1 Answers

I would recommend using Storyboard Unwind Segues instead: https://developer.apple.com/library/ios/technotes/tn2298/_index.html

This insightful post also has a wealth of very useful implementation detail:

What are Unwind segues for and how do you use them?

like image 136
Andrew Ebling Avatar answered Nov 15 '22 06:11

Andrew Ebling