iOSTable not editable if not DataSource?

The docs say Addrow is fine for a few rows, but more than that ,use a DataSource

I have a few rows, so used AddRow
In the simulator, I cannot get anything other than Action to fire… it’s like swipe left (give me options) aren’t being recognised by the mouse.

I populate the iOSTable with this in a loop…

cd = listoffiles.createcell cd.text = "Some text" me.ListOfFiles.AddRow 0, cd

ACTION fires when a row is selected by pressing on it.

ACCESSORYACTION contains this, and doesnt fire:

Dim selectedCell As iOSTableCellData = Me.RowData(section, row) system.debuglog selectedcell.text

ACTIONSFOROW contains this, but never fires

[code]Dim Actions(0) As iOSTableRowAction
Const kArchiveTag As Text = “Archive”
// Create the Flag button
Actions(0) = New iOSTableRowAction(iOSTableRowAction.Styles.Normal, “Flag”,kArchiveTag)

return Actions

ROWACTION… never fires

Dim selectedCell As iOSTableCellData = Me.RowData(section, row) system.debuglog "RowAction"

Right. The docs note:

Also as noted only the Detail accessory track touches, so AccessoryAction is only called for the Detail accessory:

Called when the accessory (currently only Detail) for a row is tapped.

So unless I use a data source, I can’t get left swipe ‘Delete’ to appear?


sigh. OK.

If you were using Xcode you would need to use a data source regardless. It really is the best method. And if you ever have scope creep (as we always do :slight_smile: ) it’s a lot easier to expand with a data source.

Well, Xojo (along with its earlier names) has been traditionally known to turn things easy when they aren’t in the first place.

I’m using Xojo also because I don’t want to use all the sub-mechanisms provided by an OS. AppleEvents, FolderItems, Sockets. They are all provided by Xojo and are an abstraction of “how they work” under the hood.

Currently, I’m trying to make my first iOS app. Adding rows to an iOSTable is more complicated in iOS than in desktop; why didn’t Xojo just provided the same mechanism (“AddRow” to add a new row and properties to then allow a checkmark) for iOS?
I mean, adding less than 10 rows means one of these:
• Either use a DataSource. I have never used them, albeit I know Xojo well enough, because iOS is differently handled by Xojo than other supported platforms. Also, adding a class interface just to have 2 rows in a list is rather overcomplicated.
• Or add rows by hand, like in other supported platforms. Then, you can’t have more than just a list (no “Delete” button, no working checkmark, nothing; useless).
Is one of these 2 options better than the other?

Earlier, RB/RS had a real cross platform way of coding (you could use a push button in Mac, Windows or Linux with a single control, for instance, even thought they may have different properties on each OS).
Then appeared Web and iOS, with their WebButton and iOSButton. They could all be a “PushButton” with non-applicable properties (e.g. “default” would do nothing on iOS). The Window class has, for example, a DockItem property only available for Mac OS, so it’s not a problem to have “inactive” properties in the language.

While an iOSButton could be a Pushbutton, although “default” and “cancel” properties don’t exist in UIButton, you can’t compare Listbox to iOSTable.

The Xojo listbox isn’t a native control and it is used to display rows with cells.
The iOSTable is a native control that displays rows in sections.

Xojo did make things simple by enabling the simple iOSTable.AddRow without a datasource. If you only need to display clickable rows it can be done with just two lines of code. This isn’t useless, half of my iOSTables don’t need a datasource.

Handling more advanced features, such as delete, requires a datasource.
The TableDataSourceDatabase example project is a good way to start using datasources.

FWIW, in the first release of iOS, AddRow is all there was…