Skip to content

Instantly share code, notes, and snippets.

@pnc pnc/section.m
Created Feb 1, 2013

Embed
What would you like to do?
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
You can’t perform that action at this time.