Instance Method


Requests permission to end editing.


- (BOOL)textShouldEndEditing:(NSText *)textObject;



The text object requesting permission to end editing.

Return Value

YES if the text object should proceed to finish editing and resign first responder status. If the delegate returns NO, the text object selects all of its text and remains the first responder.

The NSMatrix method returns NO if the text field contains invalid contents; otherwise it returns the value passed back from control:textShouldEndEditing:.


This method is invoked to let the NSTextField respond to impending loss of first-responder status. This method’s default behavior checks the text field for validity; providing that the field contents are deemed valid, and providing that the delegate responds, control:textShouldEndEditing: is sent to the receiver’s delegate (passing the receiver and textObject as parameters).

See Also

Editing Text in Cells

- selectText:

Selects text in the currently selected cell or in the key cell.

- selectTextAtRow:column:

Selects the text in the cell at the specified location and returns the cell.

- textShouldBeginEditing:

Requests permission to begin editing text.

- textDidBeginEditing:

Invoked when there’s a change in the text after the receiver gains first responder status.

- textDidChange:

Invoked when a key-down event or paste operation occurs that changes the receiver’s contents.

- textDidEndEditing:

Invoked when text editing ends.