diff --git a/AXWebViewController/AXWebViewController/AXWebViewController.m b/AXWebViewController/AXWebViewController/AXWebViewController.m index d56862b..c447f3c 100644 --- a/AXWebViewController/AXWebViewController/AXWebViewController.m +++ b/AXWebViewController/AXWebViewController/AXWebViewController.m @@ -504,10 +504,19 @@ - (void)dealloc { #if AX_WEB_VIEW_CONTROLLER_USING_WEBKIT _webView.UIDelegate = nil; _webView.navigationDelegate = nil; - [_webView removeObserver:self forKeyPath:@"estimatedProgress"]; - [_webView removeObserver:self forKeyPath:@"scrollView.contentOffset"]; - [_webView removeObserver:self forKeyPath:@"title"]; - // [_webView.scrollView removeObserver:self forKeyPath:@"backgroundColor"]; + @try{ + [_webView removeObserver:self forKeyPath:@"estimatedProgress"]; + [_webView removeObserver:self forKeyPath:@"scrollView.contentOffset"]; + [_webView removeObserver:self forKeyPath:@"title"]; + // [_webView.scrollView removeObserver:self forKeyPath:@"backgroundColor"]; + } + @catch (NSException *exception) { + NSLog(@"%@", exception.reason); + } + @finally { + NSLog(@"remove webview Observer fail"); + } + #else _webView.delegate = nil; #endif