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