The Response I Get :
{"response":{"id":"R1","cmd":[{"batchSize":50,"startRow":0,"name":"doLogin","result":"OK","attributes":[{"name":"businessName","type":"String"},{"name":"objId","type":"Long"},{"name":"businessType","type":"String"},{"name":"firstName","type":"String"},{"name":"businessName","type":"String"},{"name":"objId","type":"Long"},{"name":"businessType","type":"String"},{"name":"firstName","type":"String"}],"records":[["businessName\":\"Palo Alto Egg - Distributor","objId\":\"200","businessType\":\"D","firstName\":\"System"],["businessName\":\"Palo Alto Egg - Distributor","objId\":\"200","businessType\":\"D","firstName\":\"System"],["businessName\":\"Palo Alto Egg - Distributor","objId\":\"200","businessType\":\"D","firstName\":\"System"],["businessName\":\"Palo Alto Egg - Distributor","objId\":\"200","businessType\":\"D","firstName\":\"System"]]}]}}
Now The Problem IS That....... NSDictionary *json = [NSJSONSerialization JSONObjectWithData:(NSData *)obj options:kNilOptions error:&error];
NSDictionary *first = [json objectForKey:@"response"];
NSArray *second = [first objectForKey:@"cmd"];
NSArray *attribute_array = [[second objectAtIndex:0] objectForKey:@"result"];
NSLog(@"Resultttttttttt=%@",attribute_array);
//Value of Result
NSString *resultVal = [NSString stringWithFormat:@"%@",attribute_array];
NSArray *record_array = [[second objectAtIndex:0] objectForKey:@"records"];
NSLog(@"Resultttttttttt Nisarg = %@",[[record_array objectAtIndex:0] objectForKey:@"firstName\\"]);
In the last sentence when I'm trying to fetch the value for the key firstName it gives Error because the structure is like "firstName\" instead of key "firstName" so any suggestion to parse the string with "firstName\" Key....