本文介绍了在这种情况下,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“错误"对于类型查找是模棱两可的
发布评论