IOS says you can't parse such a JSON?

topic description

the returned json format is as follows

{
    "status": 1,
    "content": "get seats info successfully",
    "data": {
        "seats": {
            "1": {
                "nickname": "salamander",
                "avatar": "*******************",
                "uid": 5464
            },
            "3": {
                "nickname": "coopk",
                "avatar": "***********************",
                "uid": 54645645
            }
        }
    }
}

he said that the data in seats cannot be parsed with numbers like 1,3. Please consult everyone

.

can be parsed if it does not exist. And'1' is not a number, this is the string'1'.


to see this, there is a guess.
iOS side uses some json to transfer to some components of the class,
, but the general class attribute name can not directly use numbers, so although your this is a standard json, when it is converted to the corresponding class object, it is unable to parse the 1 and 3.
it is really troublesome to use json in some languages, such as


json key can only be a string

Menu