"RestInfo": [
{
"id": "1",
"store_id": "3",
"staff_id": "1075",
"default_rest": "0",
"restaurant_name": "Imagine Restaurant",
"restaurant_location": "Sydney",
},
{
"id": "3",
"store_id": "3",
"staff_id": "1085",
"default_rest": "0",
"restaurant_name": "MealsAustralia",
"restaurant_location": "Nsw",
},
NSError *err;
NSURLResponse *response;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err];
NSDictionary *jsonArray = [NSJSONSerialization JSONObjectWithData:responseData options: NSJSONReadingMutableContainers error: &err];
NSArray *array=[jsonArray objectForKey:@"RestInfo"];
for (int i=0; i<[array count]; i++) {
NSLog(@"the restrunt==%@",[[array objectAtIndex:i]objectForKey:@"restaurant_location"]);
我只能得到一個JSON值,但我需要得到更多的價值,請幫助我,我很新的目標C.相同的JSON對象值
解釋一下你想要什麼......! – Mani
在JSON數組結構中沒有']。 –