Objective-C 中的 WKWebview 委托方法

WKWebview Delegate methods in Objective-C

正在将我的代码从 UIWebView 更新到 WKWebview 但我的委托方法出现此错误

Nullability specifier 'nonnull' conflicts with existing specifier 'null_unspecified'

这是我的代码,在 navigation

上显示了这个错误
- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation{
  // Show & animate the activity indicator.
  _webView.spinner.hidden = NO;
  [_webView.spinner startAnimating];
}

看起来你在某个地方重新声明了这个委托方法,可能在委托 header 中,所以找到它并作为原始方法使用

- (void)webView:(WKWebView *)webView didCommitNavigation:(null_unspecified WKNavigation *)navigation;