深入细节视图:开发流程与代码实现
1. 细节视图数据处理
在开发中,我们需要根据属性名称检索对象。以下是相关代码:
NSString *rowLabel = [rowLabels nestedObjectAtIndexPath:indexPath];
id <HeroValueDisplay, NSObject> rowValue = [hero valueForKey:rowKey];
cell.detailTextLabel.text = [rowValue heroValueDisplay];
cell.textLabel.text = rowLabel;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
这里,我们先获取行标签,再根据属性键获取对应的值对象。最后将标签和值赋给单元格的标签,并设置附件类型,返回单元格。
同时,还有一个待实现的方法:
- (void)tableView:(UITableView *)theTableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// TODO: Push editing controller onto the stack.
}
2. 使用新控制器
2.1 声明出口
为了使用新的
超级会员免费看
订阅专栏 解锁全文

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



