iOS UITableViewCells rows recycled and tag not working

后端 未结 2 1918
广开言路
广开言路 2021-01-25 22:34

I would like to seek some help in setting tag for buttons in cells. This is a question with a link to the previous I posted : iOS Using NSDictionary to load data into section an

2条回答
  •  星月不相逢
    2021-01-25 23:00

    You cannot use the button tags, as these will be the same as those of the cells they have been recycled from. Instead, use the indexPath to determine on which row you are and use that directly. No need to go through the button tag.

提交回复
热议问题