<!--
{
  "availability" : [
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextStorage/invalidateAttributes(in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextStorage(im)invalidateAttributesInRange:"
  },
  "title" : "invalidateAttributes(in:)"
}
-->

# invalidateAttributes(in:)

Invalidates attributes in the specified range.

```
func invalidateAttributes(in range: NSRange)
```

## Parameters

`range`

The range of characters whose attributes the method should invalidate.

## Discussion

Called from [`processEditing()`](/documentation/AppKit/NSTextStorage/processEditing()) to invalidate attributes when the text storage changes. If the receiver isn’t lazy, this method calls <doc://com.apple.documentation/documentation/Foundation/NSMutableAttributedString/fixAttributes(in:)>. If lazy attribute fixing is in effect, this method instead records the range needing fixing.

---

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)