gpt4 book ai didi

ios - Xcode 8 beta 'Error' 在此上下文中对于类型查找不明确

转载 作者:IT王子 更新时间:2023-10-29 05:39:06 25 4
gpt4 key购买 nike

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

'Method' is ambiguous for type lookup in this context, Error in Alamofire

但下面的函数是从 Apple API 调用的。我应该等到 Xcode 8 结束测试版吗?还是我遗漏了什么?

'Error' is ambiguous for type lookup in this context

AppDelegate.swift 中的函数

enter image description here

导入部分

enter image description here

最佳答案

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

当您的模块之一有自己的错误类型时会出现此问题...:/

例如:

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

我希望这对你有用:)

关于ios - Xcode 8 beta 'Error' 在此上下文中对于类型查找不明确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39394514/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com