ios - Getting element from NSString -


my app data php web service , return nsstring

["first name","last name","adress","test@test","000-000-0000","password","code","0"] 

how can second element ?

this json formatted string getting web service.

you must getting bytes server. replace variable have bytes stored variable "response data".

code:

nserror* error;     nsarray* myresultarray = [nsjsonserialization          jsonobjectwithdata:responsedata options:kniloptions error:&error]; 

you array in variable "myresultarray" , can value index.

code:

nsstring* first name = [myresultarray objectatindex:0]; 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -