Created
December 13, 2014 15:16
-
-
Save mmesarina/34c0af8889e2c339573f to your computer and use it in GitHub Desktop.
Rottentomatoes API to load movies information
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/in_theaters.json?apikey=ws32mxpd653h5c8zqfvksxw9"; | |
| 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]; | |
| self.movies = object[@"movies"]; | |
| [self.tableView reloadData]; | |
| NSLog(@"%@", object); | |
| }]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment