Instance Method

beginUpdates

Begins a group of updates for the table view.

Declaration

- (void)beginUpdates;

Discussion

For NSView-based table views, multiple row changes—that is, insertions, deletions, and moves—are animated simultaneously by surrounding calls to those method calls with beginUpdates and endUpdates. These methods are nestable.

The selected rows are maintained during the series of insertions, deletions, moves, and scrolling. If a selected row is deleted, a selection changed notification occurs after removeRowsAtIndexes:withAnimation: is called.

It is not necessary to call beginUpdates and endUpdates if only one insertion, deletion, or move is occurring and the table view is an NSView-based table view. When using an NSCell-based table view, you must surround any insertion, deletion, or move in an update block for animations to occur.

The main reason for doing a batch update of changes to a table view is to avoid having the table animate unnecessarily.

Note that these methods should be called to reflect changes in your model; they do not make any underlying model changes.

See Also

Updating the Table View Arrangement

- endUpdates

Ends the group of updates for the table view.

- moveRowAtIndex:toIndex:

Moves the specified row to the new row location using animation.

- insertRowsAtIndexes:withAnimation:

Inserts the rows using the specified animation.

- removeRowsAtIndexes:withAnimation:

Removes the rows using the specified animation.

- rowForView:

Returns the index of the row for the specified view.

- columnForView:

Returns the column index for the specified view.