All changes to the visuals of your cells should happen inside your tableView:cellForRowAtIndexPath:
. You should not do it in the event handler of your gesture recognizer (or anywhere else outside the tableView:cellForRowAtIndexPath
, for that matter).
The gesture recognizer needs to alter the model behind your table view, so that your tableView:cellForRowAtIndexPath could make a decision to set the image to notCkDone
or isCkDone
the next time the data is reloaded, and also deal with the background changes. Then your gesture recognizer should tell the table view to reload the data.
Your current solution operates on cells returned by tableView:cellForRowAtIndexPath
. When you change the visuals from the outside, the table view shows the change while the cell is on screen. However, when the cell scrolls off the screen, it gets recycled, meaning that the next time you dequeue a cell with cell identifier you may get an object that used to display as a different cell.