iOS Table Custom Cell - GetDetails

Hi there,
I think I’m getting blind. I’ve stared at this error for at long time. Can anyone see what I’ve done wrong:
It’s a iOS TableCustomCell, and I get an TypeExceptionError (Got Int32 but got GradusReport).

RowData(table as iOSTable, section as Integer, row As Integer) As iOSTableDataCell
// Part of the iOSTableDataSource interface.

Dim cell As iOSTableCellData
cell = tbl_Reports.CreateCustomCell(GetTypeInfo(ReportLine))

Dim c As GradusReport = Sections(section).gReports(row)
cell.Tag = c
Dim container As ReportLine = ReportLine(cell.Control)

container.SetValues( _
gReports(row).ID, _
gReports(row).LocationName, _
gReports(row).CustomerName, _
gReports(row).ReportType, _
gReports(row).ReportSubType, _
gReports(row).Name _

Return cell

and the receiving end:
Table.Action(section as Integer, row as Integer)
Dim details As New ReportDetail
details.gReport = gReports(Me.RowData(section, row).Tag) // This is where I get an Error

If Self.ParentSplitView <> Nil Then
// iPad
// Selecting a customer should display its details in the detail
// view of the split.
Self.ParentSplitView.Detail = details
// iPhone
End If

It looks like gReports is an array. Yet you are passing in the tag value which you have set to be a GradusReport.

My guess is that you want to cast and assign the tag value:

details.gReport = GradusReport(Me.RowData(section, row).Tag)

Excellent. Thank you Paul. Its seem I need your glasses :slight_smile: