Skip to content

Instantly share code, notes, and snippets.

@pnc
Created February 1, 2013 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pnc/4691752 to your computer and use it in GitHub Desktop.
Save pnc/4691752 to your computer and use it in GitHub Desktop.
Example of using ATV.
ATVManagedTableSection *inboxSection = [[ATVManagedTableSection alloc] initWithIdentifier:@"inbox"];
[inboxSection setManagedObjectContext:context andFetchRequest:fetchRequest];
[inboxSection registerNib:@"PIMessageCell" forIdentifier:@"PIMessageCell"];
[inboxSection setCellSource:^UITableViewCell *(ATVTableSection *section, NSUInteger index, id object) {
UITableViewCell *cell = [section dequeueReusableCellWithIdentifier:@"PIMessageCell"];
return cell;
}];
[inboxSection setConfigureCell:^(ATVTableSection *section, UITableViewCell *cell, NSUInteger index, id object) {
PIMessageCell *messageCell = (PIMessageCell *)cell;
[messageCell setMessage:object];
}];
[self.sectionedTableView addSection:inboxSection];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment