<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSOrderedSet/init(orderedSet:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSOrderedSet(im)initWithOrderedSet:"
  },
  "title" : "init(orderedSet:)"
}
-->

# init(orderedSet:)

Initializes a new ordered set with the contents of a set.

```
convenience init(orderedSet set: NSOrderedSet)
```

## Parameters

`set`

A set.

## Return Value

An initialized ordered set containing references to the objects in the set.

## See Also

[`+  orderedSetWithOrderedSet:`](/documentation/Foundation/NSOrderedSet/orderedSetWithOrderedSet:)

Creates and returns an ordered set containing the objects from another ordered set.

[`+  orderedSetWithOrderedSet:range:copyItems:`](/documentation/Foundation/NSOrderedSet/orderedSetWithOrderedSet:range:copyItems:)

Creates and returns a new ordered set for a specified range of objects in an ordered set.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)