diff options
author | 2013-07-14 15:51:15 -0400 | |
---|---|---|
committer | 2013-07-14 15:51:15 -0400 | |
commit | ba30d5c850b2712d0a5530ecc09b8616e55a40ba (patch) | |
tree | 885033d91cc83ac1dfa1057505c117a2d73fa5f9 /example/ios/iOS UI Test/iOS UI Test/MasterViewController.m | |
parent | 9da381504d06076274d893b6a73dd270b703e8aa (diff) |
Associating message rendering operation with table view cell.
* Added custom table view cell.
* Cancelling operation on cell reuse.
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 | 11 |
1 files changed, 7 insertions, 4 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 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; }]; |