ios - Parsing multiple json objects from signle nsstring variable -
i know how parse json object nsstring
using nsdata
, nsdictionary
, didn't find how parse multiple json object if message this:
{ "msg_type" : "fist_json", "field" : "param" } { "second_json_field": [ { "name_picture": "0.png", "data_picture":"something" }, { "data_values": "something" } ] } { "third_msg" : "hello" }
it's not valid json, can't parse it. json document either single array, or single object (dictionary). 3 objects not valid json. put square brackets around everything, put commas in right places, , parse it, getting array back. finding places commas without writing full-blown json parser tricky.
if server gave you, ask server people fix broken server. if code reason combined 3 json messages one, don't that.
Comments
Post a Comment