UITableView allows you to perform batch editing operations using beginUpdates and endUpdates .
My question is: should I first know if this is really done for deletion or insertion? Or can I reference everything along the index path to beginUpdates , and it will magically work?
Suppose I have a table:
A (currently index path 0,0) B (0,1) C (0,2) D (0,3) E (0,4) F (0,5)
I want to turn it into:
A (0,0) C (0,1) D (0,2) H (0,3) E (0,4) F (0,5)
So I deleted B (which was at 0.1) and inserted H (which was inserted after D - 0.4 before removal, or 0.3 after).
So, between my calls to the start / end of the update, which one will work?
- deleteRowsAtIndexPaths: 0.1 and then insertRowsAtIndexPaths: 0.4
- deleteRowsAtIndexPaths: 0.1 followed by insertRowsAtIndexPaths: 0.3
- insertRowsAtIndexPaths: 0.4, followed by deleteRowsAtIndexPaths: 0.1
- insertRowsAtIndexPaths: 0.3, followed by deleteRowsAtIndexPaths: 0.1
ios cocoa-touch uitableview
Amy worrall
source share