在这种情况下,Xcode 8 beta“错误"对于类型查找是模棱两可的

编程入门 行业动态 更新时间:2024-10-11 09:25:56
本文介绍了在这种情况下,Xcode 8 beta“错误"对于类型查找是模棱两可的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

根据本文,我需要指定要查找对象类型的模块:

According to this article, I need to specify the module to lookup object type:

方法"不明确在这种情况下进行类型查找,Alamofire中的错误

但是下面的函数是从Apple API调用的.我应该等到Xcode 8退出测试版吗?还是我错过了什么?

But the below function is call from Apple API. Should I wait until Xcode 8 is out of beta? Or am I missing anything?

在这种情况下,错误"对于类型查找是模棱两可的

'Error' is ambiguous for type lookup in this context

AppDelegate.swift

功能

导入部分

推荐答案

解决方案是只键入Swift.Error而不是Error.

The Solution is to just type Swift.Error instead of Error.

当您的模块之一具有自己的错误类型...时,就会发生此问题:/

The issue occurs when one of your modules has its own Error Type...:/

例如:

func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Swift.Error) {}

我希望这对您有用:)

更多推荐

在这种情况下,Xcode 8 beta“错误"对于类型查找是模棱两可的

本文发布于:2023-11-26 04:28:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1632625.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模棱两可   在这种情况下   错误   类型   beta

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!