Created
February 1, 2013 14:51
-
-
Save pnc/4691752 to your computer and use it in GitHub Desktop.
Example of using ATV.
This file contains 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
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