diff --git a/Code/UI/RKAbstractTableController.h b/Code/UI/RKAbstractTableController.h index d7b34d96..8e2a5972 100755 --- a/Code/UI/RKAbstractTableController.h +++ b/Code/UI/RKAbstractTableController.h @@ -101,6 +101,7 @@ extern NSString* const RKTableControllerDidBecomeOffline; @property (nonatomic, retain) RKTableViewCellMappings* cellMappings; - (void)mapObjectsWithClass:(Class)objectClass toTableCellsWithMapping:(RKTableViewCellMapping*)cellMapping; +- (void)mapObjectsWithClassName:(NSString *)objectClassName toTableCellsWithMapping:(RKTableViewCellMapping*)cellMapping; - (id)objectForRowAtIndexPath:(NSIndexPath *)indexPath; - (RKTableViewCellMapping*)cellMappingForObjectAtIndexPath:(NSIndexPath *)indexPath; diff --git a/Code/UI/RKAbstractTableController.m b/Code/UI/RKAbstractTableController.m index 9c1c12ba..64644010 100755 --- a/Code/UI/RKAbstractTableController.m +++ b/Code/UI/RKAbstractTableController.m @@ -401,6 +401,10 @@ static NSString* lastUpdatedDateDictionaryKey = @"lastUpdatedDateDictionaryKey"; [_cellMappings setCellMapping:cellMapping forClass:objectClass]; } +- (void)mapObjectsWithClassName:(NSString *)objectClassName toTableCellsWithMapping:(RKTableViewCellMapping*)cellMapping { + [self mapObjectsWithClass:NSClassFromString(objectClassName) toTableCellsWithMapping:cellMapping]; +} + - (id)objectForRowAtIndexPath:(NSIndexPath *)indexPath { NSAssert(indexPath, @"Cannot lookup object with a nil indexPath"); RKTableSection* section = [self sectionAtIndex:indexPath.section]; @@ -418,8 +422,6 @@ static NSString* lastUpdatedDateDictionaryKey = @"lastUpdatedDateDictionaryKey"; return indexPath ? [self cellForObjectAtIndexPath:indexPath] : nil; } -// TODO: unit test... -// TODO: This needs to be updated to take into account header & footer rows... - (NSIndexPath *)indexPathForObject:(id)object { NSUInteger sectionIndex = 0; for (RKTableSection *section in self.sections) {