Trying to parse JSON data in iOS -


here code , json result in app.

nsarray* logindata = [json objectforkey:@"logindata"]; //2 nslog(@"logindata: %@", logindata); //3 

and logindata array comes through this:

 logindata: {     code = 200;     goodlogin = 1; } 

how value of goodlogin?

thanks in advance

the logindata posted isn't actual json (unless there other way display don't know), understand of example, call

[json objectforkey:@"logindata"]; 

should return nsdictionary, not nsarray.

so, more like

nsdictionary *logindata = [json objectforkey:@"logindata"]; nsnumber *goodlogin = [logindata objectforkey:"goodlogin"] 

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -