In my cocoa app there is a NSTableView(10.7 lion view based tableview) only contains one column, the cell in it is a custom NSTableCellView, in it there are several views and one of them is a NSImageView.
My data model has an integer status variable, I use cocoa binding and a NSValueTransformer to give different NSImage to this NSImageView.
The problem is, the image is not updated automatically. After the status is changed, the image only reflects the change after reload the list.
Thanks for any help 🙂
Finally I solved my own question.
I added observer for model’s “status” integer property. When this status changed, the actual table cell’s icon (NSImageView) has changed according to the cocoa binding but not updated. Then in the observe callback method, just add
Then the image get updated as soon as status get changed.