【发布时间】:2016-07-25 13:34:04
【问题描述】:
如何计算每个部分的行数并填充它的数据。以下是数据。
<__NSCFArray 0x7fadb3e73a60>(
{
AMID = "";
AMName = "xyz";
records = (
{
EId = 100;
EMName = "abc";
EName = "Ename1";
}
);
EGroupId = 001;
EGroupName = "SectionName1";
stat = G;
},
{
AMID = "";
AMName = "zyx";
records = (
{
EId = 144;
EMName = "namename";
EName = "somestring";
},
{
EId = 159;
EMName = "somestring";
EName = "somestring";
},
{
EId = 161;
EMName = "somestring";
EName = "somestring";
}
);
EGroupId = 86;
EGroupName = "SectionName2";
stat = Y;
}
)
根据上面的数据,我想要部分中的“EGroupName”值并动态计算每个部分的行数(在这种情况下,它是“SectionName1 和 SectionName2”)。 最终输出应该是这样的,
**SectionName1**
return 1;
**SectionName2**
return 3;
非常感谢您的帮助。
已编辑
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *selectedEngagementGroupId = engagementGroupDataArray[indexPath.section][@"EngagementGroupId"];
NSString *selectedEngagementId = modelItem[@"EId"];
NSLog(@"EGId %@",selectedEngagementGroupId);
NSLog(@"EId %@",selectedEngagementId);
}
【问题讨论】:
标签: ios xcode uitableview nsarray nsdictionary