-8

I have a JSON array of objects with the following layout:

[{
    "user_privacy": "Private",
    "latitude": "53.34885596487662",
    "longitude": "-6.255970895290375",
    "address": "",
    "quick_ezpoint": false,
    "tags": "test",
    "owner": true,
    "value": "TQJ539"
},{
    "user_privacy": "Private",
    "latitude": "53.34885596487662",
    "longitude": "-6.255970895290375",
    "address": "",
    "quick_ezpoint": false,
    "tags": "test",
    "owner": true,
    "value": "TQJ539"
}]

I tried this code but its not working:

NSArray *ezpoints = [JSON valueListAttributes];
                for (NSArray *ezpoint in ezpoints) {
                    NSLog(@"%@",[ezpoint description]);
                }
Noor
  • 19,638
  • 38
  • 136
  • 254
  • 2
    There are at least several of these questions every day. Come on, people, do some basic debugging/google/Stackoverflow searching before asking! – dandan78 Oct 30 '13 at 07:22
  • possible duplicate of [iPhone/iOS JSON parsing tutorial](http://stackoverflow.com/questions/5813077/iphone-ios-json-parsing-tutorial) – Dinesh Kaushik Oct 30 '13 at 07:25
  • @user1774937:I can't you. You dont know how to get JSON from url? or You to parse your JSON value? please tell – TamilKing Oct 30 '13 at 07:29

1 Answers1

0
for(NSDictionary * dict in ezpoints)
{
    [userPrivacyArray addObject:[dict valueForKey:@"user_privacy"]];
    [LattitudeArray addObject:[dict valueForKey:@"latitude"]];
    [LongitudeArray addObject:[dict valueForKey:@"longitude"]]
}

parse the data using valueForKey using key you can identify your json data and stored into NSArray, NSString where you want.

here userPrivacyArray,LattitudeArray,LongitudeArray all are array.

try this stuff.

Jitendra
  • 5,055
  • 2
  • 22
  • 42