I’m totally confused, The docs say “The data could be in a database, dictionary, array or anything else you want.” But doesn’t say how you implement it.
I looked in the EEiOS Demo and in that the Open Event of the view it says CustomerTable.DataSource = Self?
Self refers to the view. I just don’t get it.
Thanks for answering the Stupid questions.
its an interface
ANYTHING that implements that interface can be used as the data source for the table
So you could create a class that holds a recordset and implements iostabledatasource and now you have a table that can use a recordset as its data source
Or you could have a class that crafted fake data randomly and use that
Or an http socket (the class hold a reference to an http socket that provides that data)
It’s an interface. You implement the interface in your view, then return your data in the appropriate methods for the table from wherever you store the data (database, dictionary, array, etc).
An iOSTableDataSource is an interface. You implement for whatever class that will act as the source of your data. In the case of the EEiOS example, the data is loaded from a SQLite DB into an array (of Customer class). The CustomerView is the data source because it is set as an iOSTableDataSource interface and has implemented the methods to return the data from the array (RowCount, RowData, SectionCount, SectionTitle).
You do not have to use an iOSTableDataSource to populate an iOSTable, though. You can just add the rows yourself. The iOS XojoNotes examples demonstrates that (and is also covered in detail in the Creating the XojoNotes App webinar.
Guys thanks, I’ll have to take it slow as I’m somewhat lost.
Paul I think this would be a terrific topic for a webinar.
I’ll also point out that if you are just getting familiar with iOSTable and iOSTableDataSource, you may want to take a look at the simpler TableDataSource example.