Skip to content

Instantly share code, notes, and snippets.

@mmesarina
Created October 18, 2014 04:18
Show Gist options
  • Save mmesarina/cbf4c4c9b2cb15d5ca97 to your computer and use it in GitHub Desktop.
Save mmesarina/cbf4c4c9b2cb15d5ca97 to your computer and use it in GitHub Desktop.
RottenTomatoes cellForRowAtIndex code
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"Number of Movies = %lu", (unsigned long)self.movies.count);
// Configure the cell...
//UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil
MovieCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyMovieCell"];
NSDictionary *movie = self.movies[indexPath.row];
cell.movieTitleLabel.text = movie[@"title"];
cell.synopsisLabel.text = movie[@"synopsis"];
NSDictionary *posters = movie[@"posters"];
NSString *posterUrlString = posters[@"detailed"];
[cell.posterView setImageWithURL:[NSURL URLWithString:posterUrlString]];
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment