JSON objects have unordered keys. iOS is not sorting the keys in the data structure. It's just sorting them when you print out the result (for convenience). Internal to the data structure, there is no guaranteed order. It depends on how things hash.
There is no way to use NSJSONSerialization to create an "ordered dictionary" since ordered dictionaries don't exist in JSON. The way you fix this is to use a list of dictionaries, such as:
[ { "First": "A" }, { "Second", "B" } ]
This is promised to stay in order because it's a list.
If you can't change the format, and the format relies on order, then it's not proper JSON and you'll have to parse it some other way. Typically I try to do simple string parsing (splitting on newlines for instance) to find large valid JSON "chunks" that can be handed to the parser.