Swift:任何数组都不符合协议“可解码”

问题描述 投票:0回答:1

我正在解码json响应,但正在获取和排列不同的对象。这是我的实现:

public struct MyDecodable: Decodable {
    public var id: Int
    public var name: String
    public var someData: [Any]
}

这是我的错误:

enter image description here

我对大家的问题是,如何使该实现符合协议Decodable

非常感谢您的帮助

ios swift codable decodable jsondecoder
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.