记录工作遇到WKWebView的一个问题:
两个视图控制器:'AViewContrller','BViewContrller'
A有事件:
A -->push or present-->B,
B控制器的View添加了WKWebView的实例wkWebView,
并且设置了wkWebView.scrollView.delegate = self,
则当B返回A的时候会发生crash.
控制台提示:
Cannot form weak reference to instance (0x110c5dc0a) of class BViewContrller.
It is possible that this object was over-released,
or is in the process of deallocation.
在91®编程问答找到解决办法:
在BViewContrller的deinit里设置
wkWebView.scrollView.delegate = nil