Mac Developer Library

Developer

Foundation Framework Reference NSMutableOrderedSet Class Reference

Options
Deployment Target:

On This Page
Language:

NSMutableOrderedSet

NSMutableOrderedSet class declares the programmatic interface to a mutable, ordered collection of distinct objects. More...

Inheritance


Import Statement


import Foundation @import Foundation;

Availability


Available in OS X v10.7 and later.
  • Creates and returns an mutable ordered set with a given initial capacity.

    Declaration

    Objective-C

    + (instancetype)orderedSetWithCapacity:(NSUInteger)numItems

    Parameters

    numItems

    The initial capacity of the new ordered set.

    Return Value

    A mutable ordered set with initial capacity to hold numItems members.

    Discussion

    Mutable ordered sets allocate additional memory as needed, so numItems simply establishes the set’s initial capacity.

    Import Statement

    Availability

    Available in OS X v10.7 and later.

  • init(capacity:) initWithCapacity: Designated Initializer

    Returns an initialized mutable ordered set with a given initial capacity.

    Declaration

    Swift

    init(capacity numItems: Int)

    Objective-C

    - (instancetype)initWithCapacity:(NSUInteger)numItems

    Parameters

    numItems

    The initial capacity of the new ordered set.

    Return Value

    An initialized mutable ordered set with initial capacity to hold numItems members.

    Discussion

    Mutable ordered sets allocate additional memory as needed, so numItems simply establishes the set’s initial capacity.

    This method is a designated initializer of NSMutableOrderedSet.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.7 and later.

  • init() init Designated Initializer

    Initializes a newly allocated mutable ordered set.

    Declaration

    Swift

    init()

    Objective-C

    - (instancetype)init

    Return Value

    A mutable ordered set.

    Discussion

    This method is a designated initializer of NSMutableOrderedSet.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.9 and later.

  • Removes from the receiving ordered set each object that isn’t a member of another ordered set.

    Declaration

    Swift

    func intersectOrderedSet(_ other: NSOrderedSet)

    Objective-C

    - (void)intersectOrderedSet:(NSOrderedSet *)other

    Parameters

    other

    The ordered set with which to perform the intersection.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.7 and later.

  • Removes from the receiving ordered set each object that isn’t a member of another set.

    Declaration

    Swift

    func intersectSet(_ other: NSSet)

    Objective-C

    - (void)intersectSet:(NSSet *)other

    Parameters

    other

    The set with which to perform the intersection.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.7 and later.

  • Removes each object in another given ordered set from the receiving mutable ordered set, if present.

    Declaration

    Swift

    func minusOrderedSet(_ other: NSOrderedSet)

    Objective-C

    - (void)minusOrderedSet:(NSOrderedSet *)other

    Parameters

    other

    The ordered set of objects to remove from the receiving set.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.7 and later.

    See Also

    – minusSet:

  • Removes each object in another given set from the receiving mutable ordered set, if present.

    Declaration

    Swift

    func minusSet(_ other: NSSet)

    Objective-C

    - (void)minusSet:(NSSet *)other

    Parameters

    other

    The set of objects to remove from the receiving set.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.7 and later.

  • Adds each object in another given ordered set to the receiving mutable ordered set, if not present.

    Declaration

    Swift

    func unionOrderedSet(_ other: NSOrderedSet)

    Objective-C

    - (void)unionOrderedSet:(NSOrderedSet *)other

    Parameters

    other

    The set of objects to add to the receiving mutable ordered set.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.7 and later.

    See Also

    – unionSet:

  • Adds each object in another given set to the receiving mutable ordered set, if not present.

    Declaration

    Swift

    func unionSet(_ other: NSSet)

    Objective-C

    - (void)unionSet:(NSSet *)other

    Parameters

    other

    The set of objects to add to the receiving mutable ordered set.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.7 and later.