help you fix your problem Take one array [Int] and store your indexpath.row when click any of the button state and in cellForRowAt indexPath: method check indexpath and manage the state if indexpath exists on your array. Another way to get it done is by adding extra keys into your data model.
it helps some times I have created scroll view and sets the buttons are in the scroll view. The Buttons are scrolling horizontally and it works fine. If i clicked the button, i set background image as "Selected State" in button. My problem is how can i changed the selected state in different button, when clicking it and how can i deselected the "selected state" button when clicking the another button. , I solved this task in the following way: init method:
wish help you to fix your issue The problem is that every time you create or reuse a cell you're giving it a new like button, so when you reuse a cell where the like button has been activated, you're giving it a deactivated like button but the old, activated like button is still there as well. Instead of creating a like button every time you need a cell, you should just be setting the state of an existing like button. See the answers to this question for some possible ways of handling that.
UITableview or AQGridView maintain state of button in cell