Instance Method

removeObjectsInArray:

Removes from the receiving array the objects in another given array.

Declaration

- (void)removeObjectsInArray:(NSArray<ObjectType> *)otherArray;

Parameters

otherArray

An array containing the objects to be removed from the receiving array.

Discussion

This method is similar to removeObject:, but it allows you to efficiently remove large sets of objects with a single operation. If the receiving array does not contain objects in otherArray, the method has no effect (although it does incur the overhead of searching the contents).

This method assumes that all elements in otherArray respond to hash and isEqual:.

See Also

Removing Objects

- removeAllObjects

Empties the array of all its elements.

- removeLastObject

Removes the object with the highest-valued index in the array

- removeObject:

Removes all occurrences in the array of a given object.

- removeObject:inRange:

Removes all occurrences within a specified range in the array of a given object.

- removeObjectAtIndex:

Removes the object at index .

- removeObjectsAtIndexes:

Removes the objects at the specified indexes from the array.

- removeObjectIdenticalTo:

Removes all occurrences of a given object in the array.

- removeObjectIdenticalTo:inRange:

Removes all occurrences of anObject within the specified range in the array.

- removeObjectsFromIndices:numIndices:

Removes the specified number of objects from the array, beginning at the specified index.

Deprecated
- removeObjectsInRange:

Removes from the array each of the objects within a given range.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software