<!--
{
  "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/NSAttributedString/init(attributedString:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSAttributedString(im)initWithAttributedString:"
  },
  "title" : "init(attributedString:)"
}
-->

# init(attributedString:)

Creates a new attributed string from the contents of another attributed string.

```
init(attributedString attrStr: NSAttributedString)
```

## Parameters

`attrStr`

An attributed string.

## Return Value

An [`NSAttributedString`](/documentation/Foundation/NSAttributedString) object initialized with the characters and attributes of `attrStr`.

## See Also

[`-  initWithRTF:documentAttributes:`](/documentation/Foundation/NSAttributedString/init(RTF:documentAttributes:))

Creates an attributed string by decoding the stream of RTF commands and data in the specified data object.



---

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)