我有一個JSON如下。如何使用JSONModel映射有序的NSDictionary
odds: {
0501: {
x: 2.75,
description: "a"
},
0502: {
x: 3.25,
description: "b"
},
0513: {
x: 3.5,
description: "c"
},
0503: {
x: 3.5,
description: "d"
},
0505: {
x: 7.5,
description: "e"
},
0504: {
x: 7.5,
description: "f"
},
0512: {
x: 10,
description: "g"
}
}
該散列來自HTTP響應,我想說明,但我使用JSONModel的東西來映射它,只有映射的是NSDictionary的方式。當把這個JSON映射到NSDictionary時(你可以猜到),這個無序的數據序列混合起來。
那麼,如何映射這個JSON,而不會使用JSONModel和NSDictionary分解它的序列?
將此json轉換爲NSDictionary時會發生什麼? –
序列更改。 – miletliyusuf
由於沒有這樣的東西作爲有序的'NSDictionary',並且JSON字典中的鍵的順序也是不相關的,爲什麼你在這裏擔心命令? – rmaddy