ios - How to get event_id from this JSON -
I am working on API which retrieves JSON data as below:
event_id I am trying to get under the custom_prop object. Is there a solution for me to solve this matter?
Try this:
NSString * da = [NSString stringWithFormat: @ "{\" Status \ ": \" 1 \ ", \" Notice \ ": [{\" id \ ": \" 175 \ ", \" from_user \ ": \" 3 \ ", \" to_user \ ": \" Content \ ": \" Azri invited you to join the Captor. \ ", \" Is_read \ ": \" 0 \ ", \" type \ ": \" 20 \ ", \" created_date \ ": \" 2014-04-17 04:11:02 \ ", \" custom_prop \ ": [{\" status \ ": \" 1 \ ", \" Apiai_nam \ ": \" \ "Event_invite \", \ "event_id \", \ "event_id \", \ "event_id \", \ "event_name \": \ "false \", \ "invitee \": \ "7 \"}], \ "from_user_avatar_url \": "string UTL \"}]} "]; Ansdita * data 1 = [Dr. data Using encoding Ansutif 8 string encoding]; NSString * strdata = [[NSString alloc] initWithData: data 1 encoding: NSUTF8StringEncoding]; Anselog (@ "Pratisadon% @", Strdta); Ansiarar e = null; Ansdraisn * Jason = [NSJSANSIILIZATION JSONObjectWithDa Ta: Data 1 Options: Kenil Option Error: & amp; A]; NSArray * myArray = [Jason Objektforki: @ "notifications"]; for (NSDictionary * in myArray dict) {NSArray * myArray2 = [dict objectForKey: @ " custom_prop "] to: (a myArray2 NSDictionary * dict) {NSString * eventId = [dict objectForKey: @" event_id "]; Anselog (@" Iventaidi =% @ ", Iventaidi);}}
Comments
Post a Comment