ios - 一个部分中的表格单元格不同数组

标签 ios uitableview

您好,我有三个 NSMutableArray。例如数组 - a ,b c。假设所有 3 个数组的大小均为 3。

想问一下如何创建 3 个部分,每个部分包含 3 行(根据数组编号)。在每个部分中,a的第1行,b的第2行,c的第3行

1st Section:
[a objectAtIndex:1]
[b objectAtIndex:1]
[c objectAtIndex:1]

2nd Section:
[a objectAtIndex:2]
[b objectAtIndex:2]
[c objectAtIndex:2]

3rd Section:
[a objectAtIndex:3]
[b objectAtIndex:3]
[c objectAtIndex:3]

谢谢!!

最佳答案

创建另一个数组并将 a,b,c 数组压入其中

NSArray container =@[a,b,c];

在你的tableview cellforRow
使用 container[indexPath.row][indexPath.section]

关于ios - 一个部分中的表格单元格不同数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20990050/

相关文章:

android - 您如何即时创建应用程序?

ios - 伪造到另一个 View Controller 的导航

ios - 以编程方式或 XIB 实现 TableView Cell

swift - T.Type 和 [T.Type] 之间的不同行为

ios - 如何创建试飞邀请码?

ios - 有没有办法让键盘触发按钮按下?

ios - 远程通知的自定义声音

ios - react native axios 请求在 IOS 模拟器中不起作用

swift - 标签中的文本从屏幕溢出 iOS Swift

ios - 在动态 UITableView 原型(prototype)中访问行高