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

# processEditing()

Cleans up changes to the text storage object and notifies its delegate and layout managers of changes.

```
func processEditing()
```

## Discussion

This method is automatically invoked in response to an [`edited(_:range:changeInLength:)`](/documentation/AppKit/NSTextStorage/edited(_:range:changeInLength:)) message or an <doc://com.apple.documentation/documentation/Foundation/NSMutableAttributedString/endEditing()> message if edits were made within the scope of a <doc://com.apple.documentation/documentation/Foundation/NSMutableAttributedString/beginEditing()> block. You should never need to invoke it directly.

This method begins by posting an [`willProcessEditingNotification`](/documentation/AppKit/NSTextStorage/willProcessEditingNotification) to the default notification center (which results in the delegate receiving a [`textStorage(_:willProcessEditing:range:changeInLength:)`](/documentation/AppKit/NSTextStorageDelegate/textStorage(_:willProcessEditing:range:changeInLength:)) message). Then it fixes attributes. After this, it posts an [`didProcessEditingNotification`](/documentation/AppKit/NSTextStorage/didProcessEditingNotification) to the default notification center (which results in the delegate receiving a [`textStorage(_:didProcessEditing:range:changeInLength:)`](/documentation/AppKit/NSTextStorageDelegate/textStorage(_:didProcessEditing:range:changeInLength:)) message). Finally, it sends a [`textStorage(_:edited:range:changeInLength:invalidatedRange:)`](/documentation/AppKit/NSLayoutManager/textStorage(_:edited:range:changeInLength:invalidatedRange:)) message to each of the receiver’s layout managers using the argument values provided.

---

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)