My viewController has a UIView property which contains a WKWebView. And I set the WKWebView scrollView delegate to my viewController, which is a public function of my UIView subClass and called in my viewController.
The issue is when I call [viewController popViewControllerAnimated], it will crash on [UIScrollView setDelegate:].
I have fixed the issue by add viewController.UIView.WKWebView.scrollView.delegate = nil; in viewController's dealloc.
But why? WKWebView's dealloc is after viewController's dealloc, I suppose viewController is set to nil and dealloc in WKWebView will update its delegate to nil then cause BAD_ACCESS? But why dealloc will inplicit call setDelegate???