Q:

How to get a Dictionary Object from a Web Service

I'm using a web service that gives back JSON data of jobs. I have called the service and displayed ALL the JSON data as such:
- (void)viewDidLoad
{
[super viewDidLoad];

NSString *urlString = @"http://jobs.github.com/positions.json?description=python&location=new+york";

NSURL *url = [NSURL URLWithString:urlString];

NSData *data = [NSData dataWithContentsOfURL:url];

NSArray *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];

NSString *item = [json objectAtIndex:0];

NSLog(@"%@", item);

// Do any additional setup after loading the view.

}
So this returns one job with  TON of information such as "description", "company name", "location". I want to be able to get JUST location or JUST description. How would I go about doing that?
All help is appreciated, thanks.

A:

In your case you can access it directly:
NSDictionary *item = [json objectAtIndex:0];
NSString *location = [item objectForKey:@"location"];
NSLog(@"%@", location);

