Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Access to the TableViewCell of a ListDataSource
-
I Have TableView using a ListDataSource with an array of dict items containing the title, and accessory_type of detail_button.
I am attempting to get the info button in my TableView to show some detail text. I need to set the text on the TableViewCell.detail_text_label.
ListDataSource.accesssory_action is triggerred correctly but I can't find any way of getting the TableViewCell associated with the activated item. I've looked for them on the root view, the TableView, the ListDataSource and even on my array of ListDataSource items. I was sure the ListDataSource internally creates one of these cells for each of my items but I can't find them.Is there no way to get access the cells? Do I have to implement my own ListDataSource so I can call tableview_cell_for_row() to create and maintain my own list of TableViewCells?
Thanks.
-
You can use the
tapped_accessory_row
attribute of theListDataSource
. -
tapped_accessory_row is just an index. I need the actual TableViewCell.
I'm getting closer. It turns out the cell_for_row() method returns the TableViewCell I need. I was assuming it only created new ones because that is what the example in the docs is doing.However the detail_text_label is None.
I guess I have to create my own tooltip label.