Xcode报错:Unnamed parameters must be written with the empty name
Xcode报错:Unnamed parameters must be written with the empty name

Xcode报错:Unnamed parameters must be written with the empty name

SwiftUI 类在初始化阶段报错:

Cannot find type 'fixedDepositType' in scope
Unnamed parameters must be written with the empty name '_'

通常是因为报错的字段缺失类型导致。

var fixedDepositType

因为没写类型,编译器会把fixedDepositType当成类型名,然后发生报错:

Cannot find type 'fixedDepositType' in scope

解决方案:添加类型。

var fixedDepositType: String

   

如果您认为这篇文章给您带来了帮助,您可以在此通过支付宝或者微信打赏网站开发者。

欢迎加入我们的 微信交流群QQ交流群,交流更多精彩内容!
微信交流群二维码 QQ交流群二维码

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注