Skip to content

Instantly share code, notes, and snippets.

View timothy1ee's full-sized avatar

Timothy Lee timothy1ee

View GitHub Profile
@timothy1ee
timothy1ee / gist:8308396
Last active January 2, 2016 13:09
Objective C Rotten Tomatoes snippet
NSString *url = @"http://api.rottentomatoes.com/api/public/v1.0/lists/movies/box_office.json?apikey=dagqdghwaq3e3mxyrp7kmmj5&limit=20&country=us";
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
id object = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
NSLog(@"%@", object);
}];