Saving JSON Object Dictionary Keys in Order in Objective-C

I am using JSON-FRAMEWORK in a C object to parse a JSON object. When I call [jsonString JSONValue], I return the dictionary, but the keys are not in the same order as the JSON Object that I am processing. Is there a way to keep this order the same?

+2
source share
1 answer

In JSON objects, by definition, the order of key-value pairs does not make sense. The specification allows the JSON producer to rearrange them in whatever way he wants, even arbitrarily, and does not require the parser to keep order. RFC 4627 says:

/    , - , - , ,    boolean, null, object array.

, JSON, , JSON.

+15

Source: https://habr.com/ru/post/1617968/


All Articles