I have a view based NSTableView that I sometimes filter using NSPredicate. Is there any way to animate the items being removed/added/reordered throughout the tableview to have the same effect as beginUpdates, endUpdates and insertRowsAtIndexes:withAnimation, etc?
I’ve explored ways such as manually filtering out my array but my attempts proved to be futile so now I am wondering if there is a better (or built in way) to do this. I have wondered if NSArrayController does this automatically but I don’t think it does.
I’ve written code to do this myself – given ‘before’ and ‘after’ arrays, compute the required parameters to
insertRowsAtIndexPaths:,deleteRowsAtIndexPaths:, etc. The code is a bit fiddly so probably has bugs – use at your discretion!Then you call it like this: