Argument type ‘xxx‘ expected to be an instance of a class or class-constrained type

Swift初始化对象时报参数类型错误,如下:

Argument type 'Double' expected to be an instance of a class or class-constrained type

Argument type 'String' expected to be an instance of a class or class-constrained type

Cannot convert value of type 'String' to expected dictionary value type 'Double'

 

解决方法为对象参数Argument type ‘xxx‘ expected to be an instance of a class or class-constrained type_第1张图片

中[String: AnyObject] 修改为[String: Any]。

你可能感兴趣的:(iOS,swift)