diff options
Diffstat (limited to 'example/ios/iOS UI Test/iOS UI Test/MasterViewController.m')
-rw-r--r-- | example/ios/iOS UI Test/iOS UI Test/MasterViewController.m | 15 |
1 files changed, 13 insertions, 2 deletions
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 5bbc0d53..7540eee8 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,10 +168,20 @@ finishedRefreshWithFetcher:(GTMHTTPFetcher *)fetcher } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell *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; + cell.messageRenderingOperation = [self.imapSession plainTextBodyRenderingOperationWithMessage:message + folder:@"INBOX"]; + + [cell.messageRenderingOperation start:^(NSString * plainTextBodyString, NSError * error) { + cell.detailTextLabel.text = plainTextBodyString; + cell.messageRenderingOperation = nil; + }]; return cell; } |