This may be a very simple answer but I cant find a good tutorial to help me. I am trying to parse a json string that I had returned from a http post the json string looks like this when I log it:
(
{
"ADD_CITY" = BEDFORD;
"ADD_LINE1" = "100 COURT AVE";
"ADD_LINE2" = "";
"ADD_STATE" = IA;
"ADD_ZIP" = 50833;
"BUSINESS_NAME" = "";
"FIRST_NAME" = JOHN;
"LAST_NAME" = DOE;
},
{
"ADD_CITY" = BEDFORD;
"ADD_LINE1" = "101 COURT AVE";
"ADD_LINE2" = "";
"ADD_STATE" = IA;
"ADD_ZIP" = 50833;
"BUSINESS_NAME" = "";
"FIRST_NAME" = BOB;
"LAST_NAME" = JOHNSON;
}
)
I am trying to make so I can insert each value of each place into a coredata table that I have made but I am getting stuck parsing this into something I can work with. I have read I have to do something with using NSJSONSerialization.
edit
-(void)getLocations{
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
NSDictionary *parameters = @{@"code": @"123"};
[manager POST:@"website.com/getjson" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"JSON: %@", responseObject);
response = responseObject;
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
}