iphone - I send some data to a webservice, it returns some JSON as NSData. How to convert to Dict?(iOS 4.3) -


i send credentials web-service.

i can responce nsdata or nsstring.

whats simpleist way convert (nsdata or nsstring)json nsdictionary can process it?

building ios4.3 many thanks, -code

download sbjsonparser framework using link, http://github.com/stig/json-framework/downloads , add required classes project (sbjsonparser.h).

import sbjsonparser.h , use following code,

    sbjsonparser *parser = [[sbjsonparser alloc] init];       //dictionary name,id      nsdictionary *jsonobject = [parser objectwithstring:jsonstring error:null];         //name array                       nsmutablearray *namearray = [[nsmutablearray alloc]init];    (nsmutabledictionary *dic in jsonobject){        [namearray addobject:[dic valueforkey:@"name"]];     } 

Comments

Popular posts from this blog

Glib GIOChannel -

jsp - java.sql.SQLException: [Microsoft][ODBC Microsoft Access > Driver] Too few parameters. Expected 1 -

delphi - When I encode/decode SMS PDU (GSM 7 Bit) user data, do I need prepend the UDH first? -