Removes all occurrences within a specified range in the array of a given object.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
- (void)removeObject:(Object Type)anObject inRange:(NSRange)range;
Parameters
anObject
The object to be removed from the array’s content.
aRange
The range from which to remove
an
.Object Important
Raises an exception
NSRange
ifException a
exceeds the bounds of the array.Range
Discussion
Matches are determined by comparing an
to the objects in the receiver using the is
method. If the array does not contain an
within a
, the method has no effect (although it does incur the overhead of searching the contents).