NSMutableOrderedSet class declares the programmatic interface to a mutable, ordered collection of distinct objects.
- iOS 5.0+
- macOS 10.7+
- tvOS 5.0+
- watchOS 2.0+
NSMutableOrderedSet objects are not like C arrays. That is, even though you may specify a size when you create a mutable ordered set, the specified size is regarded as a “hint”; the actual size of the set is still 0. This means that you cannot insert an object at an index greater than the current count of an set. For example, if a set contains two objects, its size is 2, so you can add objects at indices 0, 1, or 2. Index 3 is illegal and out of bounds; if you try to add an object at index 3 (when the size of the array is 2),
NSMutableOrderedSet raises an exception.