I have a NSTableView
that is bound to a NSArrayController
. The NSArrayController
's contentSet
property is bound to a NSMutableSet
. Everything works great.
Now I want to use the animations built in to NSTableView
to remove rows. I can do this with - [NSTableView removeRowsAtIndexes:withAnimation:]
and the row quickly animates away, however the object I removed from the tableview is still hanging out in the NSMutableSet
that is backing the tableview. Obviously I need to remove it. If I try to remove it through the NSArrayController
's removeObject:
method then the object disappears from the tableview immediately which means the animation doesn't occur or gets cut off halfway through.
Bindings work wonders and make things so much easier but what exactly is the proper method for keeping the data source and tableview in sync when both bindings and NSTableView
animations are being used? The answer should also address how to add rows to a bound NSTableView
using animations.
NSArrayController
and override the adding and removing methods to notify your table view which object/index will be removed/added/moved. Not altogether sure if this would work or not. – GeothermalNSArrayController
as a signal to update your own content as needed. I really can't think of any way. – GeothermalNSCollectionView
, which does support animation while using bindings. I think, however, that it would be understatement to say that the use ofNSCollectionView
introduces its own set of issues with which you'd have to contend. – Ovotestis[tableview removeRow...]
and then delete object from array at same index? – Gigantic