Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
我的结构不符合协议“Decodable”/“Encodable”
我试图使用 Codable 来保存我正在创建的应用程序中的数据 但是当我将 Codable 放入我的结构中时 我不断收到错误 类型 ReminderGroups 不符合协议 Decodable and 类型 ReminderGroups 不
swift
Structure
Codable
decodable
在 swift 中使用 UUID() 和 json
我在网上找到了在 json 文件中使用硬编码 uuid 的示例 并且这些示例非常适合我 但是当我在应用程序中添加从 json 数组中删除项目的功能时 我需要动态创建这些 uuid 这是我的json文件 list json 它曾经有硬编码的i
json
swift
Codable
decodable
Swift:可编码 - 提取单个编码密钥
我有以下代码来提取编码密钥中包含的 JSON let value try decoder decode String Applmusic self from 0 applmusic 这成功处理了以下 JSON applmusic code
ios
json
swift
Codable
decodable
如何解码不同类型的 JSON 属性? [复制]
这个问题在这里已经有答案了 我有一个 JSON tvShow id 5348 name Supernatural permalink supernatural url http www episodate com tv show super
json
swift
Alamofire
swift4
decodable
将 Decodable 与继承一起使用会引发异常
我正在使用 Rest API 服务 其中响应分为基本响应 所有其他响应都继承自它 我正在尝试使用解码器接口为我的响应模型类构建相同的结构 但是我在继承类的解码方面遇到问题 我试图关注这个问题 在 Swift 4 中使用 Decodable
swift
decodable
可编码:不符合“可解码”协议
无法弄清楚为什么我的课程不符合 Codable 请注意 就我而言 我不需要实现这些方法encode and decode public class LCLAdvantagePlusJackpotCache Codable public le
swift
Codable
decodable
子类化 swift 通用可解码类型
EDIT As 罗布 纳皮尔写道 https stackoverflow com a 49540809 9565342 Xcode 9 2 中存在该问题 在 Xcode 9 3 中 该问题不再相关 我的服务器 json 响应都打包在里面da
ios
json
swift
decodable
Swift Codable:如何将顶级数据编码到嵌套容器中
我的应用程序使用返回 JSON 的服务器 如下所示 result OK data Common to all URLs user name John Smith ETC Different for each URL data for thi
ios
swift
Codable
decodable
encodable
使用 JSONDecoder 解码 PascalCase JSON
我需要用大写首字母 又名 PascalCase 或 UppperCamelCase 解码 JSON 如下所示 Title example Items hello world 所以我创建了一个符合以下条件的模型Codable struct M
json
swift
uppercase
Codable
decodable
如何使用 swift 4 解析 JSON
我对获取水果的细节感到困惑 fruits id 1 image https cdn1 medicalnewstoday com content images headlines 271 271157 bananas jpg name Ban
json
swift
Codable
decodable
如何从 Swift 4 中的 Decoder 容器获取未解码的属性?
我正在使用Decodable协议以便解析从外部源接收到的 JSON 解码我所知道的属性后 JSON 中可能仍然有一些未知且尚未解码的属性 例如 如果外部源在未来某个时间点向 JSON 添加了新属性 我希望通过将这些未知属性存储在 Strin
ios
json
swift
swift4
decodable
使用 swift Codable 从 JSON 数组中提取数据
我有一个像这样的 JSON 响应 我目前设计的可解码结构如下 struct PortfolioResponseModel Decodable var dataset Dataset struct Dataset Decodable var
json
swift
swift4
Codable
decodable
何时在 Decodable(Swift) 中使用 CodingKeys
假设我想按如下方式解码 Person 结构 struct Person Decodable let firstName String let lastName String let age Int String 据我所知 数据只能用上面的方
swift
Codable
decodable
字符串字典:任何不符合协议“可解码”[重复]
这个问题在这里已经有答案了 我正在尝试实现 Decodable 来解析 json 请求 但 json 请求在对象内部有一个字典 这是我的代码 struct myStruct Decodable let content String Any
swift
decodable
使用Decodable进行JSON解析时,可选和decodeIfPresent有什么区别?
我在用Codable第一次使用 Swift 4 的协议 我无法理解其使用decodeIfPresent from Decodable Decodes a value of the given type for the given key i
swift
swift4
Codable
decodable
Swift 4 Decodable:嵌套数组的结构
鉴于以下 JSON 文档 我想创建一个struct有四个属性 filmCount Int year Int category 字符串 以及actor 演员阵列 filmCount 5 year 2018 category Other act
json
swift
Codable
decodable
可解码和 JSON,同一变量有 2 种数据类型
我正在使用 Decodable 协议来解码一些 json 但遇到了一个问题 我得到了答案 其中如果没有向元素添加地理位置数据 则经度和纬度可以是整数 latitude 0 如果有地理数据 则可以是字符串 fx latitude 25 047
json
swift4
decodable
swift41
可解码嵌套数据,无需在 Swift 中创建额外的类
我是 iOS 开发新手 很抱歉提前提出愚蠢的问题 我有这样的 json type post comments count 0 can post 1 likes count 0 user likes 0 can like 1 can publ
ios
json
swift
decodable
Swift 4 JSON 可解码,具有多维和多类型数组
values 1 1 7 Azuan Child Anak Azuan 12345 ACTIVE Morning 7 12 2017 11 09 19 45 00 28 1 0 Azuan Child2 Amran 123456 ACTIV
Arrays
json
multidimensionalarray
swift4
decodable
我们可以在 Swift 上重用 struct 吗?或者还有其他办法吗?
所以我有一个用户 JSON 结构 如下所示 results meta users status 我想让用户这样User我实现的获取 JSON 的模型如下 struct Response Decodable let results Resul
ios
json
swift
decodable
1
2
»