Instance Method

insertItemsAtIndexes:inParent:withAnimation:

Inserts new items at the given indexes in the given parent with the specified optional animations.

Declaration

- (void)insertItemsAtIndexes:(NSIndexSet *)indexes inParent:(id)parent withAnimation:(NSTableViewAnimationOptions)animationOptions;

Parameters

indexes

Indexes at which to insert items.

parent

The parent for the items, or nil if the parent is the root.

animationOptions

Animated slide effects used when inserting items.

Discussion

This method parallels the insertRowsAtIndexes:withAnimation: method of NSTableView and is used in a way similar to the insertObjects:atIndexes: method of NSMutableArray. The method does nothing if parent is not expanded. The actual item values are determined by the data source’s outlineView:child:ofItem: method (which is called only after endUpdates to ensure data source integrity).

You can call this method multiple times within the same beginUpdates/endUpdates block; new insertions move previously inserted new items, just like modifying an array. Inserting an index beyond what is available throws an exception.

See Also

Manipulating Items

- moveItemAtIndex:inParent:toIndex:inParent:

Moves an item at a given index in the given parent to a new index in a new parent.

- removeItemsAtIndexes:inParent:withAnimation:

Removes items at the given indexes in the given parent with the specified optional animations.