From 739398c238744901170a3800bd3d19f3ad584911 Mon Sep 17 00:00:00 2001 From: Paul Young Date: Mon, 15 Jul 2013 00:10:22 -0400 Subject: Registered a class for cell reuse. --- example/ios/iOS UI Test/iOS UI Test/MCTTableViewCell.m | 6 ++++++ example/ios/iOS UI Test/iOS UI Test/MasterViewController.m | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'example') diff --git a/example/ios/iOS UI Test/iOS UI Test/MCTTableViewCell.m b/example/ios/iOS UI Test/iOS UI Test/MCTTableViewCell.m index bf0df5fb..1c45b0ec 100644 --- a/example/ios/iOS UI Test/iOS UI Test/MCTTableViewCell.m +++ b/example/ios/iOS UI Test/iOS UI Test/MCTTableViewCell.m @@ -10,6 +10,12 @@ @implementation MCTTableViewCell +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier]; + return self; +} + - (void)prepareForReuse { [self.messageRenderingOperation cancel]; diff --git a/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m b/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m index b6a2206e..7540eee8 100644 --- a/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m +++ b/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m @@ -168,7 +168,10 @@ finishedRefreshWithFetcher:(GTMHTTPFetcher *)fetcher } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - MCTTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; + NSString * cellIdentifier = @"Cell"; + [tableView registerClass:[MCTTableViewCell class] forCellReuseIdentifier:cellIdentifier]; + + MCTTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath]; MCOIMAPMessage *message = self.messages[indexPath.row]; cell.textLabel.text = message.header.subject; -- cgit v1.2.3