0
无法转换类型“[MyProtocol]”的值与预期的参数类型“INOUT _”
我试图找出是什么让这发生了,但我失败了,有什么问题吗?
确实有其他人遇到这样的错误?
我怎样才能为这样做,我需要帮助
这是我的代码:
protocol MyProtocol {
}
struct MyStruct: MyProtocol {
}
let structs = [MyStruct(), MyStruct()]
var protocols = [MyProtocol]()
protocols = structs // it's ok
protocols += structs // this got an error