Adding addObject: method to RKTableSection.

This commit is contained in:
Jawwad Ahmad
2012-06-13 11:45:26 -04:00
committed by Blake Watters
parent f35f81ca0c
commit f035af7a67
2 changed files with 7 additions and 1 deletions

View File

@@ -50,6 +50,7 @@
+ (id)sectionForObjects:(NSArray *)objects withMappings:(RKTableViewCellMappings *)cellMappings;
- (id)objectAtIndex:(NSUInteger)rowIndex;
- (void)addObject:(id)object;
- (void)insertObject:(id)object atIndex:(NSUInteger)index;
- (void)removeObjectAtIndex:(NSUInteger)index;
- (void)replaceObjectAtIndex:(NSUInteger)index withObject:(id)object;

View File

@@ -110,9 +110,14 @@
return _tableController.tableView;
}
- (void)addObject:(id)object
{
return [self insertObject:object atIndex:[_objects count]];
}
- (void)insertObject:(id)object atIndex:(NSUInteger)index
{
[(NSMutableArray *)_objects insertObject:object atIndex:index];
[(NSMutableArray*)_objects insertObject:object atIndex:index];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index
inSection:[_tableController indexForSection:self]];