[
{
"Id": 52,
"Name": "name1",
"author": "john"
},
{
"Id": 53,
"Name": "name2",
"author": "jacob"
},
{
"Id": 54,
"Name": "name3",
"author": "jobin"
}
]
I used the following code to fetch and parse this json array with no main key
SBJsonParser *parser1 = [[SBJsonParser alloc] init];
NSURLRequest *request1 = [NSURLRequest requestWithURL:[NSURL URLWithString:str2]];
// Perform request and get JSON back as a NSData object
NSData *response1 = [NSURLConnection sendSynchronousRequest:request1 returningResponse:nil error:nil];
NSError *error;
NSArray *jsonArray = [NSJSONSerialization JSONObjectWithData:response1 options:kNilOptions error:&error];
but i am getting the following exception
data parameter is nil
this exception is occuring at this code
NSData *response1 = [NSURLConnection sendSynchronousRequest:request1 returningResponse:nil error:nil];
How to iterate the id value?
jsonArray?main keyto access elements? you can easily access elements.