Multiple selection in UITableView. And the tables are dynamically generated

感情迁移 提交于 2020-01-16 17:22:05

问题


I have multiple uitableviews.
I created the multiple tables by using a loop.
The number of tables depend on the result of the webservice.
And each table have multiple selections. I have to pass all the values selected from every table to next webservice.

How can I do this task ?

Thank You,


回答1:


1-> you can use check Boxes for in your UITableView for mutli section (Check box can be implemented by UIButton). one check box per row.

2-> Use a flag (BOOL isSelected),set it true when user select a cell (tableView:didSelectRowAtIndexPath:),and make it false for next touch,

for second approach you could use a custom UITableViewCell and use a image to show cell selection to the user (image can be changed by using isSelected value in tableView:didSelectRowAtIndexPath: method.



来源:https://stackoverflow.com/questions/5392497/multiple-selection-in-uitableview-and-the-tables-are-dynamically-generated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!