Created
October 18, 2014 04:19
-
-
Save mmesarina/ed2643f4ebcfdbb3ea25 to your computer and use it in GitHub Desktop.
RottenTomatoes ViewDidLoad of MoviesTableViewController
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
| - (void)viewDidLoad { | |
| [super viewDidLoad]; | |
| 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]; | |
| // NSLog(@"%@", object); | |
| self.movies = object[@"movies"]; | |
| [self.tableView reloadData]; | |
| }]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment