From ba30d5c850b2712d0a5530ecc09b8616e55a40ba Mon Sep 17 00:00:00 2001 From: Paul Young Date: Sun, 14 Jul 2013 15:51:15 -0400 Subject: Associating message rendering operation with table view cell. * Added custom table view cell. * Cancelling operation on cell reuse. --- example/ios/iOS UI Test/iOS UI Test/MasterViewController.m | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'example/ios/iOS UI Test/iOS UI Test/MasterViewController.m') 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 1b2528d1..c05fdd9a 100644 --- a/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m +++ b/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m @@ -11,6 +11,7 @@ #import "FXKeychain.h" #import "MCTMsgViewController.h" #import "GTMOAuth2ViewControllerTouch.h" +#import "MCTTableViewCell.h" #define CLIENT_ID @"the-client-id" #define CLIENT_SECRET @"the-client-secret" @@ -167,15 +168,17 @@ finishedRefreshWithFetcher:(GTMHTTPFetcher *)fetcher } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; + MCTTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; MCOIMAPMessage *message = self.messages[indexPath.row]; cell.textLabel.text = message.header.subject; - MCOIMAPMessageRenderingOperation * op = [self.imapSession plainTextBodyRenderingOperationWithMessage:message - folder:@"INBOX"]; + [cell.messageRenderingOperation cancel]; - [op start:^(NSString * htmlString, NSError * error) { + cell.messageRenderingOperation = [self.imapSession plainTextBodyRenderingOperationWithMessage:message + folder:@"INBOX"]; + + [cell.messageRenderingOperation start:^(NSString * htmlString, NSError * error) { cell.detailTextLabel.text = htmlString; }]; -- cgit v1.2.3