Progress bar in NSTableCellView changes to other cell when scrolling

Hello, I'm not I00% sure how to ask this, so I apologize if I word it wrong.

This is Obj-C from an older project I have. My app has a NSTableView and each cell has a button to perform and action and shows a progress bar in each cell. The issue I'm running in to is when I scroll down while a task is running the running progress bar shows running on a different cell. So if its he 2nd from the bottom and a scroll an even number of row its equivalent is now showing the progress bar. How do I target just that one cell; making it unique?

NSTableCellView are reused, to avoid wasting memory. So you will have to keep this in mind when designing the way you update the cells.

One way to is subclass NSTableCellView, add a property that contains the object doing the work, and then observe the progress of the object. This avoid having to find the right cell everything.

When a cell is reused, just swap the object and refresh the observers.

Progress bar in NSTableCellView changes to other cell when scrolling
 
 
Q