我有以下JSON。將沒有名稱標籤的json分配給Jastor
{
"ILS" : {
"currencyAbrv" : Israel Shekel,
"currencyDesc" : Israel, Shekel,
"currencySymbol" : ,
"decimalPlaces" : 2
},
"MTW" : {
"currencyAbrv" : MTW,
"currencyDesc" : MTW,
"currencySymbol" : ,
"decimalPlaces" : 2
},
"KPW" : {
"currencyAbrv" : Korea (North) Won,
"currencyDesc" : Korea (North), Won,
"currencySymbol" : ,
"decimalPlaces" : 2
}
}
我想將這個json賦值給swift中的以下類的數組。
class Currency: Jastor {
var currencyAbrv = ""
var currencyDesc = ""
var currencySymbol = ""
var decimalPlaces = 0 }
但問題是json沒有名稱標籤,我們可以與類關聯。 我該怎麼做?
這個JSON不是有效的JSON –