最近将我的项目升级到 Xcode 8 并且无法编译我的项目。一切在 Xcode 7 中运行良好,但似乎无法弄清楚这里出了什么问题。
不断获得可空性说明符“可空”与现有说明符“无空”冲突。
这是代码:
@interface NotificationViewController () <UIWebViewDelegate>
@property (weak, nonatomic) IBOutlet UIWebView *webNotification;
@end
@implementation NotificationViewController
// Error on next line
- (void)webView:(UIWebView *)webView didFailLoadWithError:(nullable NSError *)error
{
[MBProgressHUD hideHUDForView:self.view animated:YES];
}
@end
有什么见解吗?
最佳答案
查看 didFailLoadWithError:
的文档委托(delegate)方法。请注意它与您的代码中的内容有何不同。你需要让它一样。
只需放弃对 nullable
的误用.
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
关于ios - 更新到 Xcode 8 后编译项目时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42792641/