我必须动态生成一个 json 字符串并需要发送到服务器。有没有人知道如何使用NSJSONSerialization
. 下面是我的字符串
{
"surveyid": "Survey1",
"responsetime": "dd/mm/yyyy hh:mm:ss",
"location": null,
"surveyresponses": [
{
"questionid": "111",
"responses": [
{
"response": "Good",
"optionid": 1,
"language": "en"
}
]
},
{
"questionid": "112",
"responses": [
{
"response": "bad",
"optionid": 2,
"language": "en"
}
]
}
]
}
如何创建 string.json?