Objective C - NSDictionary 问题
您好,我是 Objective C 的新手,想知道如何形成具有以下结构的 NSDictionary。
1级
等级属性1.1 - 等级分数 - 等级百分比
等级属性1.2 - 等级分数 - 等级百分比
等级属性1.3 - 等级分数 - 等级百分比
2级
等级属性2.1-等级分数-等级百分比
等级属性2.2-等级分数-等级百分比
等级属性2.3-等级分数-等级百分比
3级
等级属性3.1-等级分数-等级百分比
等级属性3.2-等级分数-等级百分比
等级属性 3.3 - 等级分数 - 等级百分比
提前感谢各位。
Hi I am a newbie to objective C and was wondering how I could form an NSDictionary with the following structure.
level 1
level attribute 1.1 - level score - level percent
level attribute 1.2 - level score - level percent
level attribute 1.3 - level score - level percent
level 2
level attribute 2.1 - level score - level percent
level attribute 2.2 - level score - level percent
level attribute 2.3 - level score - level percent
level 3
level attribute 3.1 - level score - level percent
level attribute 3.2 - level score - level percent
level attribute 3.3 - level score - level percent
Thanks in advance guys.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个具有三个键(“level 1”、“level 2”和“level 3”)的 NSDictionary。看起来该字典的每个字段都包含一个具有三个值的数组,每个值都是一个带有级别属性、分数和百分比的 NSDictionary。
要记住的是 NSDictionary 本身并不是一个嵌套结构。它只是一组键值对。但它可以包含其他对象作为值,包括 NSArrays 和 NSDictionaries。
That's an NSDictionary with three keys ("level 1", "level 2" and "level 3"). Looks like each field of that dictionary contains an array that has three values, each of which is an NSDictionary with the level attribute, score, and percent.
The thing to remember is that NSDictionary isn't BY ITSELF a nested structure. It's just a set of key-value pairs. But it can contain other objects as values, including NSArrays and NSDictionaries.