mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Remove cell param from cellMapping heightOfCellForObjectAtIndexPath block, to avoid issues with and infinite loop. Change a few form methods to comply with tableController nomenclature. Fix broken specs and issues with tableController naming conventions in UI specs.
This commit is contained in:
committed by
Blake Watters
parent
1617dd3ac4
commit
8ec9ac811e
@@ -515,9 +515,8 @@ static NSString* lastUpdatedDateDictionaryKey = @"lastUpdatedDateDictionaryKey";
|
||||
RKTableViewCellMapping* cellMapping = [self cellMappingForObjectAtIndexPath:indexPath];
|
||||
|
||||
if (cellMapping.heightOfCellForObjectAtIndexPath) {
|
||||
UITableViewCell* cell = [self tableView:self.tableView cellForRowAtIndexPath:indexPath];
|
||||
id object = [self objectForRowAtIndexPath:indexPath];
|
||||
CGFloat height = cellMapping.heightOfCellForObjectAtIndexPath(cell, object, indexPath);
|
||||
CGFloat height = cellMapping.heightOfCellForObjectAtIndexPath(object, indexPath);
|
||||
RKLogTrace(@"Variable row height configured for tableView. Height via block invocation for row at indexPath '%@' = %f", indexPath, cellMapping.rowHeight);
|
||||
return height;
|
||||
} else {
|
||||
|
||||
@@ -108,8 +108,8 @@ typedef void(^RKFormBlock)();
|
||||
// TODO: Implement me...
|
||||
//- (BOOL)validate:(NSArray**)errors;
|
||||
|
||||
- (void)willLoadInTableViewModel:(RKTableController *)tableController;
|
||||
- (void)didLoadInTableViewModel:(RKTableController *)tableController;
|
||||
- (void)willLoadInTableController:(RKTableController *)tableController;
|
||||
- (void)didLoadInTableController:(RKTableController *)tableController;
|
||||
|
||||
// Sent from the form section
|
||||
- (void)formSection:(RKFormSection *)formSection didAddTableItem:(RKTableItem *)tableItem forAttributeAtKeyPath:(NSString *)attributeKeyPath;
|
||||
|
||||
@@ -249,10 +249,10 @@
|
||||
|
||||
#pragma mark - Subclass Hooks
|
||||
|
||||
- (void)willLoadInTableViewModel:(RKTableController *)tableController {
|
||||
- (void)willLoadInTableController:(RKTableController *)tableController {
|
||||
}
|
||||
|
||||
- (void)didLoadInTableViewModel:(RKTableController *)tableController {
|
||||
- (void)didLoadInTableController:(RKTableController *)tableController {
|
||||
_tableController = tableController;
|
||||
}
|
||||
|
||||
|
||||
@@ -255,7 +255,7 @@
|
||||
// The form replaces the content in the table
|
||||
[self removeAllSections:NO];
|
||||
|
||||
[form willLoadInTableViewModel:self];
|
||||
[form willLoadInTableController:self];
|
||||
for (RKFormSection *section in form.sections) {
|
||||
NSUInteger sectionIndex = [form.sections indexOfObject:section];
|
||||
section.objects = [self objectsWithHeaderAndFooters:section.objects forSection:sectionIndex];
|
||||
@@ -269,7 +269,7 @@
|
||||
// }
|
||||
|
||||
[self didFinishLoad];
|
||||
[form didLoadInTableViewModel:self];
|
||||
[form didLoadInTableController:self];
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDataSource methods
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
/** @name Cell Mapping Block Callbacks **/
|
||||
|
||||
typedef void(^RKTableViewCellForObjectAtIndexPathBlock)(UITableViewCell *cell, id object, NSIndexPath* indexPath);
|
||||
typedef CGFloat(^RKTableViewHeightOfCellForObjectAtIndexPathBlock)(UITableViewCell *cell, id object, NSIndexPath *indexPath);
|
||||
typedef CGFloat(^RKTableViewHeightOfCellForObjectAtIndexPathBlock)(id object, NSIndexPath *indexPath);
|
||||
typedef void(^RKTableViewAccessoryButtonTappedForObjectAtIndexPathBlock)(UITableViewCell *cell, id object, NSIndexPath *indexPath);
|
||||
typedef NSString*(^RKTableViewTitleForDeleteButtonForObjectAtIndexPathBlock)(UITableViewCell *cell, id object, NSIndexPath *indexPath);
|
||||
typedef UITableViewCellEditingStyle(^RKTableViewEditingStyleForObjectAtIndexPathBlock)(UITableViewCell *cell, id object, NSIndexPath *indexPath);
|
||||
|
||||
Reference in New Issue
Block a user