iOSTable.AddRow

From Xojo Documentation

Method

iOSTable.AddRow(section As Integer, rowText As Text)

Supported on Mobile(iOS).

Adds the rowText to the section.

Parameters

Parameter Description
section The section where the row will be added.
rowText The text to use for the row that is added.


Method

iOSTable.AddRow(section As Integer, data As iOSTableCellData)

Supported on Mobile(iOS).

Adds the cell data to the section.

Parameters

Value Description
section The section where the row will be added.
data The iOSTableCellData to use for the row that is inserted.

Notes

There has to be at least one section before you can add rows or you will get an OutOfBoundsException. If you do not want the section to appear, you can add it with a blank title.

If you are adding many rows, you should instead use iOSTableDataSource for better performance and reduced memory usage.

Exceptions

Exception Description
OutOfBoundsException When the section does not exist. At least one section must be added to the table before adding rows.
UnsupportedOperationException When the table has a DataSource specified.

Sample Code

Adds five rows to a table:

Table1.AddSection("") // No section will appear
For i As Integer = 0 To 4
Table1.AddRow(0, "Row " + i.ToText)
Next

Adds five rows to a table using a cell:

Table1.AddSection("") // No section will appear
Var cell As iOSTableCellData

For i As Integer = 0 To 4
cell = Table1.CreateCell("Row " + i.ToText)
Table1.AddRow(0, cell)
Next