-5
我有一個問題,當談到採取JSON從服務器的JSON的一個例子是這樣的:swift怎麼辦?
[{
"subject": "First Post",
"body": "This is a test post coming from mySQL server",
"user": "user",
"date": "2017-04-30",
"comments": "[]",
"id": 1 }]
我不知道這會做出什麼樣的對象,並坦率地說,如何desteralize它,如果你能幫助我,將不勝感激。
這是一個數組中的字典,以迅捷的方式。 https://developer.apple.com/swift/blog/?id=37 – luk2302
@ luk2302s評論和我的答案[這裏]的組合(https://stackoverflow.com/questions/43700443/how-to-write- own-model-mapper-in-swift-language/43700629#43700629)你會解決這個問題。 –
將JSON轉換爲Dicotionary ,,,,這裏是你的解決方案https://stackoverflow.com/questions/30480672/how-to-convert-a-json-string-to-a-dictionary – Dhiru