Instance Method

replaceObjectsAtIndexes:withObjects:

Replaces the objects in the receiving array at locations specified with the objects from a given array.

Declaration

- (void)replaceObjectsAtIndexes:(NSIndexSet *)indexes withObjects:(NSArray<ObjectType> *)objects;

Parameters

indexes

The indexes of the objects to be replaced.

objects

The objects with which to replace the objects in the receiving array at the indexes specified by indexes. The count of locations in indexes must equal the count of objects.

Discussion

The indexes in indexes are used in the same order as the objects in objects.

If objects or indexes is nil, this method raises an exception.

See Also

Replacing Objects

- replaceObjectAtIndex:withObject:

Replaces the object at index with anObject.

- setObject:atIndexedSubscript:

Replaces the object at the index with the new object, possibly adding the object.

- replaceObjectsInRange:withObjectsFromArray:range:

Replaces the objects in the receiving array specified by one given range with the objects in another array specified by another range.

- replaceObjectsInRange:withObjectsFromArray:

Replaces the objects in the receiving array specified by a given range with all of the objects from a given array.

- setArray:

Sets the receiving array’s elements to those in another given array.