ios - How to parse {status:0,val:450} from a HTML response -
i want take 450
from following:
nsstring {status:0,val:450}
using objective c:
{status:0,val:450}
please suggest me answer
i cannot understand question . think have have json data like:
{ status:0; val:450; }
if want data in app. want
nsurl *blogurl = [nsurl urlwithstring:@"https://your url here"]; nsdata *jsondata = [nsdata datawithcontentsofurl:blogurl]; nserror *error = nil; nsdictionary *datadictionary = [nsjsonserialization jsonobjectwithdata:jsondata options:0 error:&error]; nsdictionary *data = [datadictionary objectforkey:@"status"]; nsdictionary *item = [data objectforkey:@"val"];
your json data in dictionary format. can access data using key. in here keys status , val.
i hope links you. fetch parse json ios programming tutorial , link: json parsing in ios
Comments
Post a Comment