Interface

iOSMobileTableDataSource


Description

A data source to use to populate a Table.

Methods

Name

Parameters

Returns

Shared

RowCount

table As iOSMobileTable, section As Integer

Integer

RowData

table As iOSMobileTable, section As Integer, row As Integer

MobileTableCellData

SectionCount

table As iOSMobileTable

Integer

SectionTitle

table As iOSMobileTable, section As Integer

String

Method descriptions


iOSMobileTableDataSource.RowCount

RowCount(table As iOSMobileTable, section As Integer) As Integer

Return the number of rows for the section.

Your class should return the number of rows in your data source for this section. For example, if you are showing a list of names in sections for the first letter of the last name, then this method would return the number of names in the specified section.


iOSMobileTableDataSource.RowData

RowData(table As iOSMobileTable, section As Integer, row As Integer) As MobileTableCellData

The actual cell data for the section and row.

You will need to create an MobileTableCellData instance and populate it with the values from your data source to return it from this method.


iOSMobileTableDataSource.SectionCount

SectionCount(table As iOSMobileTable) As Integer

Return the number of sections.

You should return the total number of sections in your data source. For example, if you are displaying names with sections for each letter of the alphabet, then you might return 26 here.

If you are not using sections, you can return 1 since there always needs to be at least one section.


iOSMobileTableDataSource.SectionTitle

SectionTitle(table As iOSMobileTable, section As Integer) As String

Return the title for the section.

If you are not using sections, you can return empty text ("") here.

When using sections, return the name for the specified section. For example, if you are displaying names with sections for each letter of the alphabet, you might return "A" when section of 0 is passed in as a parameter.

Notes

To use the interface, create a class that implements the interface to manage the data. The data could be in a database, dictionary, array or anything else you want. Your class implements the methods below to return the appropriate values based on the data it is managing.

For best performance, use a data source instead of adding the rows to the table manually using the various AddRow methods.

Compatibility

iOS projects on the iOS operating system.