I’m working on an app that has a bunch of tables displaying different categories of items with identical fields. I’ve defined a class for the item that has properties for the fields. The data for all the items in a category is stored in an array containing instances of the class. So I have as many arrays as I have tables. This makes displaying each table trivial using an IOSTableDataSource. For example, RowData is defined as:
Dim cell As New iOSTableCellData
cell.Text = armor(row).name
cell.DetailText = "Tech Level " + armor(row).techlevel
cell.AccessoryType = iOSTableCellData.AccessoryTypes.Detail
Return cell
The problem is that I have to define a different IOSTableDataSource for each table, even though they are all identical except for the array they point to (“armor” in the above example).
Is there a way to generalize this so I can use a single IOSTableDataSource for all the tables? Some way to store a reference to an array in a global property?