@@ -33,9 +33,12 @@ - (void)viewDidLoad
33
33
self.tableController .autoRefreshFromNetwork = YES ;
34
34
self.tableController .pullToRefreshEnabled = YES ;
35
35
self.tableController .resourcePath = @" /repos/RestKit/RestKit/issues" ;
36
+ self.tableController .variableHeightRows = YES ;
36
37
NSSortDescriptor *descriptor = [NSSortDescriptor sortDescriptorWithKey: @" createdAt" ascending: NO ];
37
38
self.tableController .sortDescriptors = [NSArray arrayWithObject: descriptor];
38
39
40
+ [self .tableView registerNib: [UINib nibWithNibName: @" RKGHIssueCell" bundle: nil ] forCellReuseIdentifier: @" RKGHIssue" ];
41
+
39
42
// TODO: Add a loading view...
40
43
41
44
/* *
@@ -46,9 +49,14 @@ - (void)viewDidLoad
46
49
render the tableView.
47
50
*/
48
51
RKTableViewCellMapping *cellMapping = [RKTableViewCellMapping cellMapping ];
49
- cellMapping.reuseIdentifier = @" RKGHIssueCell" ;
50
- [cellMapping mapKeyPath: @" title" toAttribute: @" textLabel.text" ];
51
- [cellMapping mapKeyPath: @" body" toAttribute: @" detailTextLabel.text" ];
52
+ cellMapping.cellClassName = @" RKGHIssueCell" ;
53
+ cellMapping.reuseIdentifier = @" RKGHIssue" ;
54
+ cellMapping.rowHeight = 100.0 ;
55
+ [cellMapping mapKeyPath: @" title" toAttribute: @" titleLabel.text" ];
56
+ [cellMapping mapKeyPath: @" body" toAttribute: @" descriptionLabel.text" ];
57
+ [cellMapping mapKeyPath: @" number" toAttribute: @" issueNumber" ];
58
+ [cellMapping mapKeyPath: @" user.login" toAttribute: @" creatorName" ];
59
+ [cellMapping mapKeyPath: @" createdAgo" toAttribute: @" createdAgo" ];
52
60
53
61
[tableController mapObjectsWithClass: [RKGHIssue class ] toTableCellsWithMapping: cellMapping];
54
62
}
0 commit comments