I have a multi-section table that is implementing the iOSMobileTableDataSourceEditing interface, and it is working fine in the sense that the delete and insert icons display on the table rows. I want the user to be able to add new rows to each section, so I need the insert icon to display somewhere, but not on an existing row, because those need the delete icons.
My current solution is right before the table enters edit mode, I create a empty, dummy data object in the data source for each section, reload the table sections, and give those dummy rows an insert icon. Upon leaving edit mode if any of the dummy data objects are still empty i remove them from the data sources and then reload the table section.
Is this the right way to use the insert icon? It just feels a bit clunky to me, but the Contacts app uses it that way when editing a contact.
I’ve been through several iterations of the UI, and that was one of the earlier tries. As far as presentation of the main screen, I really like the multi-section table and I would like to stick with it if I can.
The problem I had with a single toolbar Add button is that the different sections of the table have very different data types. So i would either need multiple Add buttons (one for each data type), or the single Add button would pop a chooser for the type of data you want to enter. I didn’t find either of those appealing. Ideally I would like an Add button for each table section, but I don’t think there is a built-in way to do that.
Another option I had considered was for each table section to have a single custom cell that contained a button for adding and another table to list the data for that section. Im guessing putting a table in a table cell might be frowned upon, but it does work.
That’s very close, but the data to be entered isn’t just simple text. Each row in my table is a summary of a class instance. There are probably 10 to 20 bits of data that need to be added, so an input screen will be required.