I am creating an app for as existing website. They currently has the JSON in the following format :
[
{
\"id\": \"value\",
\"array\": \"[{\
//-------------- get data url--------
NSURLRequest *request=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://echo.jsontest.com/key/value"]];
NSData *data=[NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSLog(@"response==%@",response);
NSLog(@"error==%@",Error);
NSError *error;
id jsonobject=[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error];
if ([jsonobject isKindOfClass:[NSDictionary class]]) {
NSDictionary *dict=(NSDictionary *)jsonobject;
NSLog(@"dict==%@",dict);
}
else
{
NSArray *array=(NSArray *)jsonobject;
NSLog(@"array==%@",array);
}