Attempting to load the view's a view controller while it's deallocating is isn't allowed and may result in undefined Behav IOR (<UISearchController:0x7f9c28c9d740>)
This kind of error is a headache, because this is the iOS9.0 and other errors, specifically, when Uisearchbar appears, the console will enter this type of information:
In fact, it is also very good to solve, can be added in the Dealloc method:
[self. Searchcontroller. View. Superview Removefromsuperview];
You can also add this code to the location where you use Uisearchcontroller:
OC adds this sentence:
[Self.searchcontroller loadviewifneeded];
Swift 's plus this:
self. resultsearchcontroller.loadviewifneeded ()
You can self-verify that the newly added code is sitting in the method or not, as long as the execution will solve the problem.
Uisearchcontroller attempting to load the view of a view controller while it's deallocating is isn't allowed and may result In undefined behavior