<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.0.0 - 11.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/commitEditing",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Objective-C Runtime"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(im)commitEditing"
  },
  "title" : "commitEditing"
}
-->

# commitEditing

Returns whether the receiver was able to commit any pending edits.

```
- (BOOL) commitEditing;
```

## Return Value

[`YES`](/documentation/ObjectiveC/YES) if the changes were successfully applied to the model, [`NO`](/documentation/ObjectiveC/NO) otherwise.

## Discussion

A commit is denied if the receiver fails to apply the changes to the model object, perhaps due to a validation error.

## See Also

[`- (void) discardEditing;`](/documentation/ObjectiveC/NSObject-swift.class/discardEditing)

Causes the receiver to discard any changes, restoring the previous values.



---

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)