0. Background description
It is found in the project that when the webpage is opened and closed on the iOS9 system, the application will crash and the log will be obtained after debugging:
2019-12-18 18:25:37.931 xxx[18873:407888] *** -[XXWebViewController retain]: message sent to deallocated instance 0x7ffefd68a740
1. Problem finding
I checked the properties of using WKWebView in the next page in turn, and finally found that as long as the WKWebView.scrollView.delegate
properties are set , when the page is closed, the WKWebView object will crash when it is released.
2. Solution
Just WKWebView.scrollView.delegate
set it to nil in the dealloc method of the controller .