An object representing a dynamic, unordered, uniquing collection, for use instead of a Set
variable in cases that require reference semantics.
SDKs
- iOS 2.0+
- macOS 10.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
class NSMutableSet : NSSet
Overview
The NSMutable
class declares the programmatic interface to a mutable, unordered collection of distinct objects.
The NSCounted
class, which is a concrete subclass of NSMutable
, supports mutable sets that can contain multiple instances of the same element. The NSSet
class supports creating and managing immutable sets.
NSMutableSet is “toll-free bridged” with its Core Foundation counterpart, CFMutable
. See Toll-Free Bridging for more information.
Subclassing Notes
There should be little need of subclassing. If you need to customize behavior, it is often better to consider composition instead of subclassing.
Methods to Override
In a subclass, you must override both of its primitive methods:
You must also override the primitive methods of the NSSet
class.