代码重构与功能实现:从英雄详情到通用管理对象控制器
1. 代码替换与封装
在开发过程中,我们首先对 tableView:titleForHeaderInSection: 和 tableView:cellForRowAtIndexPath: 方法中的代码进行了替换。
- tableView:titleForHeaderInSection: 替换
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
NSDictionary *sectionDict = [self.sections objectAtIndex:section];
return [sectionDict objectForKey:@"header"];
return [self.config headerInSection:section];
}
-
tableView:cellForRowAtIndexPath:替换
NSUInteger sectionIndex = [indexPath section];
NSUInteger rowIndex = [indexPath r
超级会员免费看
订阅专栏 解锁全文
7

被折叠的 条评论
为什么被折叠?



