ios - Parsing issues with socketio data with objective-c -
i getting response socketio server , not sure how parse it. receive event socketio server has packet.
here packet broken down elements , trace statements:
po packet => <socketiopacket: 0x2561a1a0> po packet.args => <__nsarrayi 0x256093e0>( {"thing_id":"519192832f9053000001","bearing":0,"mph":0,"lng":-75.14617,"on_call":true,"lat":39.98132314,"name":"bjlkd"} ) po packet.args[0] => $2 = 0x25606f60 {"thing_id":"519192832f9053000001","bearing":0,"mph":0,"lng":-75.14617,"on_call":true,"lat":39.98132314,"name":"bjlkd"}
i trying access elements , have tried converting nsarray, nsdictionary, leaving , try access if nsarray , nsdicitionary , nothing works. nothing selector errors.
anyone have clues?
the solution is:
nsdictionary *json = [nsjsonserialization jsonobjectwithdata: [packet.args[0] datausingencoding:nsutf8stringencoding] options: nsjsonreadingmutablecontainers error: &jsonparsingerror];
Comments
Post a Comment