1.異常描述:
pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
2.原因:
通過排除法走哺,發(fā)現(xiàn)只要不監(jiān)聽wkwebview.scrollview的delegate,就不會異常氮帐;
想起scrollview是strong引用:
@property (nonatomic, readonly, strong) UIScrollView *scrollView;
3.解決方法:
將delegate設(shè)置為nil:
- (void) dealloc
{
if(self.webView)
{
self.webView.scrollView.delegate=nil;
}
}