<!--
{
  "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/description(withLocale:indent:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSOrderedSet(im)descriptionWithLocale:indent:"
  },
  "title" : "description(withLocale:indent:)"
}
-->

# description(withLocale:indent:)

Returns a string that represents the contents of the ordered set, formatted as a property list.

```
func description(withLocale locale: Any?, indent level: Int) -> String
```

## Parameters

`locale`

An [`NSLocale`](/documentation/Foundation/NSLocale) object or an `NSDictionary` object that specifies options used for formatting each of the array’s elements (where recognized). Specify `nil` if you don’t want the elements formatted.

`level`

Specifies a level of indentation, to make the output more readable: the indentation is (4 spaces) * `level`.

## Return Value

A string that represents the contents of the ordered set, formatted as a property list.

## Discussion

The returned `NSString` object contains the string representations of each of the ordered set’s elements, in order, from first to last. To obtain the string representation of a given element, `descriptionWithLocale:indent:` proceeds as follows:

- If the element is an `NSString` object, it is used as is.
- If the element responds to `descriptionWithLocale:indent:`, that method is invoked to obtain the element’s string representation.
- If the element responds to `descriptionWithLocale:`, that method is invoked to obtain the element’s string representation.
- If none of the above conditions is met, the element’s string representation is obtained by invoking its `description` method

---

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)