简体   繁体   English

“结果”类型的值 <String> &#39;没有会员&#39;错误&#39;[Alamofire,Swift 5]

[英]Value of type 'Result<String>' has no member 'error' [Alamofire, Swift 5]

As Swift 5 introduced Result type, so I am getting numerous errors with Alamofire. 由于Swift 5引入了Result类型,因此我在Alamofire上遇到了很多错误。

Other Errors: 其他错误:

Enum case 'success' has no associated values
Member 'failure' in 'Result<T>' produces result of type 'Result<String>', but context expects 'Result<T>'

Any quick fix! 任何快速修复!

Change 更改

Result

to

Alamofire.Result

Or create a typealias as, 或者创建一个typealias

typealias AFResult = Alamofire.Result

and change Result to AFResult . 并将Result更改为AFResult

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “结果”类型的 Alamofire 值<any, aferror> ' 没有成员 'isSuccess' (Swift 5)</any,> - Alamofire Value of type 'Result<Any, AFError>' has no member 'isSuccess' (Swift 5) Alamofire 错误:“结果”类型的值<any, aferror> '没有成员'值'</any,> - Alamofire Error: Value of type 'Result<Any, AFError>' has no member 'value' Alamofire 5:“结果”类型的值<data, aferror> '没有成员'值'</data,> - Alamofire 5: Value of type 'Result<Data, AFError>' has no member 'value' “NSMutableDictionary”类型的值在 swift 中没有成员“字符串” - Value of type 'NSMutableDictionary' has no member 'string' in swift Alamofire 4.0与Swift 3的“没有成员”错误 - “has no member” error with Alamofire 4.0 with Swift 3 '结果类型的值<any, aferror> ' 没有成员 '值' (使用 Xcode 13.2 和 AlamoFire 5.4.3)</any,> - Value of type 'Result<Any, AFError>' has no member 'value' (with Xcode 13.2 and AlamoFire 5.4.3) 错误:类型字符串的值没有成员componentsSeparatedByCharactersInSet - Error: Value of type string has no member componentsSeparatedByCharactersInSet 错误:类型&#39;String&#39;的值没有成员&#39;URLByAppendingPathComponent&#39; - Error : Value of type 'String' has no member 'URLByAppendingPathComponent' 错误:“String”类型的值没有成员“totalAnswered” - Error: Value of type 'String' has no member 'totalAnswered' 类型字符串没有成员swift - Type string has no member swift
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM