Last active
January 2, 2016 13:09
-
-
Save timothy1ee/8308396 to your computer and use it in GitHub Desktop.
Objective C Rotten Tomatoes snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Translated to Swift: