NSEditor

A set of methods that controllers and UI elements can implement to manage editing.

Overview

The NSEditor informal protocol provides a means for requesting that the receiver commit or discard any pending edits.

These methods are typically invoked on user interface elements by a controller. They can also be sent to a controller in response to a user’s attempt to save a document or quit an application.

NSController provides an implementation of this protocol, as do the AppKit user interface elements that support binding.

Topics

Managing Editing

func discardEditing()

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

func commitEditing()

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

func commitEditingAndReturnError()

Attempt to commit pending edits, returning an error in the case of failure.

See Also

Edit Management

NSEditorRegistration

A set of methods that controllers can implement to enable an editor view to inform the controller when it has uncommitted changes.