NSResponder Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in OS X v10.0 and later.
Companion guide
Declared in
NSInterfaceStyle.h
NSResponder.h
NSWindowRestoration.h
Related sample code

Overview

NSResponder is an abstract class that forms the basis of event and command processing in the Application Kit. The core classes—NSApplication, NSWindow, and NSView—inherit from NSResponder, as must any class that handles events. The responder model is built around three components: event messages, action messages, and the responder chain.

Starting with OS X v10.4, NSResponder plays an important role in the presentation of error information. The default implementations of the presentError: and presentError:modalForWindow:delegate:didPresentSelector:contextInfo: methods send willPresentError: to self, thereby giving subclasses the opportunity to customize the localized information presented in error alerts. NSResponder then forwards the message to the next responder, passing it the customized NSError object. The exact path up the modified responder chain depends on the type of application window:

NSApplication displays a document-modal error alert and, if the error object has a recovery attempter, gives it a chance to recover from the error. (A recovery attempter is an object that conforms to the NSErrorRecoveryAttempting informal protocol.)

Tasks

Changing the First Responder

Managing the Next Responder

Responding to Mouse Events

Responding to Key Events

Responding to Other Kinds of Events

Responding to Action Messages

Handling Window Restoration

Presenting and Customizing Error Information

Dispatching Messages

Managing a Responder’s Menu

Updating the Services Menu

Getting the Undo Manager

Testing Events

Terminating the Responder Chain

Setting the Interface Style

Touch and Gesture Events

Setting the Writing Direction

Performing Text Find Actions

Class Methods

restorableStateKeyPaths

Returns an array of key paths representing the restorable attributes of the responder.

+ (NSArray *)restorableStateKeyPaths
Return Value

An array of NSString objects, each of which contains a key path to one of the responder’s attributes.

Discussion

You can use this method instead of, or in addition to, the encodeRestorableStateWithCoder: and restoreStateWithCoder: methods to save and restore the state of your responder. The key paths you return must refer to attributes that are key-value coding and key-value observing compliant.

When changes are detected, the specified attributes are automatically written to disk with the rest of the application’s interface-related state. At launch time, the attributes are automatically restored to their previous values.

Availability
  • Available in OS X v10.7 and later.
Related Sample Code
Declared In
NSWindowRestoration.h

Instance Methods

acceptsFirstResponder

Overridden by subclasses to return YES if the receiver accepts first responder status.

- (BOOL)acceptsFirstResponder
Discussion

As first responder, the receiver is the first object in the responder chain to be sent key events and action messages. The NSResponder implementation returns NO, indicating that by default a responder object doesn’t agree to become first responder.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

becomeFirstResponder

Notifies the receiver that it’s about to become first responder in its NSWindow.

- (BOOL)becomeFirstResponder
Discussion

The default implementation returns YES, accepting first responder status. Subclasses can override this method to update state or perform some action such as highlighting the selection, or to return NO, refusing first responder status.

Use the NSWindow makeFirstResponder: method, not this method, to make an object the first responder. Never invoke this method directly.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

beginGestureWithEvent:

Informs the receiver that the user has begun a touch gesture.

- (void)beginGestureWithEvent:(NSEvent *)event
Parameters
event

An event object representing the gesture beginning.

Discussion

The event will be sent to the view under the touch in the key window.

Availability
  • Available in OS X v10.5 and later.
Declared In
NSResponder.h

cancelOperation:

Implemented by subclasses to cancel the current operation.

- (void)cancelOperation:(id)sender
Parameters
sender

The object invoking this method.

Discussion

This method is bound to the Escape and Command-. (period) keys. The key window first searches the view hierarchy for a view whose key equivalent is Escape or Command-., whichever was entered. If none of these views handles the key equivalent, the window sends a default action message of cancelOperation: to the first responder and from there the message travels up the responder chain.

If no responder in the responder chain implements cancelOperation:, the key window searches the view hierarchy for a view whose key equivalent is Escape (note that this may be redundant if the original key equivalent was Escape). If no such responder is found, then a cancel: action message is sent to the first responder in the responder chain that implements it.

NSResponder declares but does not implement this method.

Availability
  • Available in OS X v10.3 and later.
Declared In
NSResponder.h

capitalizeWord:

Implemented by subclasses to capitalize the word or words surrounding the insertion point or selection, expanding the selection if necessary.

- (void)capitalizeWord:(id)sender
Parameters
sender

The object invoking the method.

Discussion

If either end of the selection partially covers a word, that entire word is made lowercase. The sender argument is typically the object that invoked this method. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

centerSelectionInVisibleArea:

Implemented by subclasses to scroll the selection, whatever it is, inside its visible area.

- (void)centerSelectionInVisibleArea:(id)sender
Parameters
sender

The object that invoked the method (typically).

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

changeCaseOfLetter:

Implemented by subclasses to change the case of a letter or letters in the selection, perhaps by opening a panel with capitalization options or by cycling through possible case combinations.

- (void)changeCaseOfLetter:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

complete:

Implemented by subclasses to complete an operation in progress or a partially constructed element.

- (void)complete:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

This method can be interpreted, for example, as a request to attempt expansion of a partial word, such as for expanding a glossary shortcut, or to close a graphics item being drawn. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

cursorUpdate:

Informs the receiver that the mouse cursor has moved into a cursor rectangle.

- (void)cursorUpdate:(NSEvent *)event
Parameters
event

An object encapsulating information about the cursor-update event (NSCursorUpdate).

Discussion

Override this method to set the cursor image. The default implementation uses cursor rectangles, if cursor rectangles are currently valid.  If they are not, it calls super to send the message up the responder chain.

If the responder implements this method, but decides not to handle a particular event, it should invoke the superclass implementation of this method.

Availability
  • Available in OS X v10.5 and later.
Declared In
NSResponder.h

deleteBackward:

Implemented by subclasses to delete the selection, if there is one, or a single element backward from the insertion point (a letter or character in text, for example).

- (void)deleteBackward:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

deleteBackwardByDecomposingPreviousCharacter:

Implemented by subclasses to delete the selection, if there is one, or a single character backward from the insertion point.

- (void)deleteBackwardByDecomposingPreviousCharacter:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If the previous character is canonically decomposable, this method should try to delete only the last character in the grapheme cluster (for example, deleting “a”+ “´” results in “a”). NSResponder declares but does not implement this method.

Availability
  • Available in OS X v10.3 and later.
Declared In
NSResponder.h

deleteForward:

Implemented by subclasses to delete the selection, if there is one, or a single element forward from the insertion point (a letter or character in text, for example).

- (void)deleteForward:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

deleteToBeginningOfLine:

Implemented by subclasses to delete the selection, if there is one, or all text from the insertion point to the beginning of a line (typically of text).

- (void)deleteToBeginningOfLine:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

Also places the deleted text into the kill buffer. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
See Also
Declared In
NSResponder.h

deleteToBeginningOfParagraph:

Implemented by subclasses to delete the selection, if there is one, or all text from the insertion point to the beginning of a paragraph of text.

- (void)deleteToBeginningOfParagraph:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

Also places the deleted text into the kill buffer. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
See Also
Declared In
NSResponder.h

deleteToEndOfLine:

Implemented by subclasses to delete the selection, if there is one, or all text from the insertion point to the end of a line (typically of text).

- (void)deleteToEndOfLine:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

Also places the deleted text into the kill buffer. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

deleteToEndOfParagraph:

Implemented by subclasses to delete the selection, if there is one, or all text from the insertion point to the end of a paragraph of text.

- (void)deleteToEndOfParagraph:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

Also places the deleted text into the kill buffer. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
See Also
Declared In
NSResponder.h

deleteToMark:

Implemented by subclasses to delete the selection, if there is one, or all items from the insertion point to a previously placed mark, including the selection itself if not empty.

- (void)deleteToMark:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

Also places the deleted text into the kill buffer. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

deleteWordBackward:

Implemented by subclasses to delete the selection, if there is one, or a single word backward from the insertion point.

- (void)deleteWordBackward:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

deleteWordForward:

Implemented by subclasses to delete the selection, if there is one, or a single word forward from the insertion point.

- (void)deleteWordForward:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

doCommandBySelector:

Attempts to perform the indicated command.

- (void)doCommandBySelector:(SEL)aSelector
Parameters
aSelector

The selector identifying the method.

Discussion

If the receiver responds to aSelector, it invokes the method with nil as the argument. If the receiver doesn’t respond, it sends this message to its next responder with the same selector. NSWindow and NSApplication also send the message to their delegates. If the receiver has no next responder or delegate, it beeps.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

encodeRestorableStateWithCoder:

Saves the interface-related state of the responder.

- (void)encodeRestorableStateWithCoder:(NSCoder *)coder
Parameters
coder

The coder object in which to save the responder’s interface-related state.

Discussion

This method is part of the window restoration system and is called at appropriate times to save the visual state of your responder to the specified archive. The default implementation of this method does nothing but specific subclasses (such as NSView and NSWindow) override it to save important state information. Therefore, if you override this method, you should always call super at some point in your implementation.

Subclasses can override this method and use it to restore any information that would be needed to restore the responder to its current state. For example, the NSTabView class uses this method to save information about the currently selected tab. You must store enough data to reconfigure the responder and return it to its current state during a subsequent launch of the application.

For information about using a coder object to write data to an archive, see Archives and Serializations Programming Guide.

Availability
  • Available in OS X v10.7 and later.
Declared In
NSWindowRestoration.h

endGestureWithEvent:

Informs the receiver that the user has ended a touch gesture.

- (void)endGestureWithEvent:(NSEvent *)event
Parameters
event

An event object representing the gesture end.

Availability
  • Available in OS X v10.5 and later.
Declared In
NSResponder.h

flagsChanged:

Informs the receiver that the user has pressed or released a modifier key (Shift, Control, and so on).

- (void)flagsChanged:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the modifier-key event.

Discussion

The default implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

flushBufferedKeyEvents

Overridden by subclasses to clear any unprocessed key events.

- (void)flushBufferedKeyEvents
Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

helpRequested:

Displays context-sensitive help for the receiver if such exists; otherwise passes this message to the next responder.

- (void)helpRequested:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the help-request event.

Discussion

NSWindow invokes this method automatically when the user clicks for help—while processing theEvent. Subclasses need not override this method, and application code shouldn’t directly invoke it.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

indent:

Implemented by subclasses to indent the selection or the insertion point if there is no selection.

- (void)indent:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

insertBacktab:

Implemented by subclasses to handle a backward tab.

- (void)insertBacktab:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

A field editor might respond to this method by selecting the field before it, while a regular text object either doesn’t respond to or ignores such a message. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

insertContainerBreak:

Implemented by subclasses to insert a container break (typically a page break) at the insertion point or selection, deleting the selection if there is one.

- (void)insertContainerBreak:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method. NSTextView implements it to insert an NSFormFeedCharacter character (0x000c).

Availability
  • Available in OS X v10.4 and later.
Declared In
NSResponder.h

insertDoubleQuoteIgnoringSubstitution:

Implemented by subclasses to insert a double quote character at the insertion point without interference by automatic quote correction.

- (void)insertDoubleQuoteIgnoringSubstitution:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.5 and later.
Declared In
NSResponder.h

insertLineBreak:

Implemented by subclasses to insert a line break (as distinguished from a paragraph break) at the insertion point or selection, deleting the selection if there is one.

- (void)insertLineBreak:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method. NSTextView implements it to insert an NSLineSeparatorCharacter character (0x2028).

Availability
  • Available in OS X v10.4 and later.
Declared In
NSResponder.h

insertNewline:

Implemented by subclasses to insert a newline character at the insertion point or selection, deleting the selection if there is one, or to end editing if the receiver is a text field or other field editor.

- (void)insertNewline:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

insertNewlineIgnoringFieldEditor:

Implemented by subclasses to insert a line-break character at the insertion point or selection, deleting the selection if there is one.

- (void)insertNewlineIgnoringFieldEditor:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

Unlike insertNewline:, this method always inserts a line-break character and doesn’t cause the receiver to end editing. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

insertParagraphSeparator:

Implemented by subclasses to insert a paragraph separator at the insertion point or selection, deleting the selection if there is one.

- (void)insertParagraphSeparator:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

insertSingleQuoteIgnoringSubstitution:

Implemented by subclasses to insert a single quote character at the insertion point without interference by automatic quote correction.

- (void)insertSingleQuoteIgnoringSubstitution:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.5 and later.
Declared In
NSResponder.h

insertTab:

Implemented by subclasses to insert a tab character at the insertion point or selection, deleting the selection if there is one, or to end editing if the receiver is a text field or other field editor.

- (void)insertTab:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

insertTabIgnoringFieldEditor:

Implemented by subclasses to insert a tab character at the insertion point or selection, deleting the selection if there is one.

- (void)insertTabIgnoringFieldEditor:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

Unlike insertTab:, this method always inserts a tab character and doesn’t cause the receiver to end editing. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

insertText:

Overridden by subclasses to insert the supplied string at the insertion point or selection, deleting the selection if there is one.

- (void)insertText:(id)aString
Parameters
aString

The string to insert or replace the selection with. aString can be either an NSString object or an NSAttributedString object.

Discussion

This method is often invoked by the system input manager after the receiver sends a interpretKeyEvents: message. The NSResponder implementation simply passes this message to the next responder, or beeps if there is no next responder.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

interpretKeyEvents:

Invoked by subclasses from their keyDown: method to handle a series of key events.

- (void)interpretKeyEvents:(NSArray *)eventArray
Parameters
eventArray

An array of key-event characters to give to the system input manager.

Discussion

This method sends the character input in eventArray to the system input manager for interpretation as text to insert or commands to perform. The input manager responds to the request by sending insertText: and doCommandBySelector: messages back to the invoker of this method. Subclasses shouldn’t override this method.

See the NSInputManager and NSTextInput class and protocol specifications for more information on input management.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

invalidateRestorableState

Marks the responder’s interface-related state as dirty.

- (void)invalidateRestorableState
Discussion

Call this method whenever the restorable state of your responder changes. This method marks the responder’s state as dirty, which causes that state to be written to disk at some point in the future. Do not override this method.

Availability
  • Available in OS X v10.7 and later.
Declared In
NSWindowRestoration.h

keyDown:

Informs the receiver that the user has pressed a key.

- (void)keyDown:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the key-down event.

Discussion

The receiver can interpret theEvent itself, or pass it to the system input manager using interpretKeyEvents:. The default implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.0 and later.
Related Sample Code
Declared In
NSResponder.h

keyUp:

Informs the receiver that the user has released a key.

- (void)keyUp:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the key-up event.

Discussion

The default implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

lowercaseWord:

Implemented by subclasses to make lowercase every letter in the word or words surrounding the insertion point or selection, expanding the selection if necessary.

- (void)lowercaseWord:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If either end of the selection partially covers a word, that entire word is made lowercase. NSResponder declares, but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

magnifyWithEvent:

Informs the receiver that the user has begun a pinch gesture.

- (void)magnifyWithEvent:(NSEvent *)event
Parameters
event

An event object representing the magnify gesture.

Discussion

The event will be sent to the view under the touch in the key window.

Availability
  • Available in OS X v10.5 and later.
Declared In
NSResponder.h

makeBaseWritingDirectionLeftToRight:

Sets the paragraph base writing direction to be left to right.

- (void)makeBaseWritingDirectionLeftToRight:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

Sets the NSAttributedString key NSWritingDirectionAttributeName to NSWritingDirectionLeftToRight.

This action method is intended to be used both as the target of a menu item and for key bindings. The base writing direction methods should be the target of three menu items in a submenu, under the Edit menu.

Default key bindings will also be provided for this method but will only be enabled for users of Hebrew or Arabic, or those who have otherwise enabled a suitable preference.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

makeBaseWritingDirectionNatural:

Sets the paragraph base writing direction to be natural.

- (void)makeBaseWritingDirectionNatural:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

Natural directionality is determined from the text in accordance with the Unicode bidi algorithm. For more information see NSParagraphStyle.

Sets the NSAttributedStringkey NSWritingDirectionAttributeName to NSTextWritingDirectionEmbedding.

This action method is intended to be used both as the target of a menu item and for key bindings. The base writing direction methods should be the target of three menu items in a submenu, under the Edit menu.

Default key bindings will also be provided for this method but will only be enabled for users of Hebrew or Arabic, or those who have otherwise enabled a suitable preference.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

makeBaseWritingDirectionRightToLeft:

Sets the paragraph base writing direction to be right to left.

- (void)makeBaseWritingDirectionRightToLeft:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

Sets the NSAttributedString key NSWritingDirectionAttributeName to NSWritingDirectionRightToLeft.

This action method is intended to be used both as the target of a menu item and for key bindings. The base writing direction methods should be the target of three menu items in a submenu, under the Edit menu.

Default key bindings will also be provided for this method but will only be enabled for users of Hebrew or Arabic, or those who have otherwise enabled a suitable preference.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

makeTextWritingDirectionLeftToRight:

Sets the character level attributed string direction attribute for left to right text.

- (void)makeTextWritingDirectionLeftToRight:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

Sets the NSAttributedString NSWritingDirectionAttributeName to NSWritingDirectionLeftToRight.

This action method is intended to be used both as the target of a menu item and for key bindings. The text writing directions should be the target of three similar menu items in a submenu under the Edit menu.

Default key bindings will also be provided for this method but will only be enabled for users of Hebrew or Arabic, or those who have otherwise enabled a suitable preference.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

makeTextWritingDirectionNatural:

Removes the character-level writing direction attribute

- (void)makeTextWritingDirectionNatural:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

Removes the NSWritingDirectionAttributeName from an NSAttributedString.

This action method is intended to be used both as the target of a menu item and for key bindings. The text writing directions should be the target of three similar menu items in a submenu under the Edit menu.

Default key bindings will also be provided for this method but will only be enabled for users of Hebrew or Arabic, or those who have otherwise enabled a suitable preference.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

makeTextWritingDirectionRightToLeft:

Sets the character-level writing direction attribute to a single right-to-left embedding.

- (void)makeTextWritingDirectionRightToLeft:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

Sets the NSAttributedString key NSWritingDirectionAttributeName to NSWritingDirectionRightToLeft.

This action method is intended to be used both as the target of a menu item and for key bindings. The text writing directions should be the target of three similar menu items in a submenu under the Edit menu.

Default key bindings will also be provided for this method but will only be enabled for users of Hebrew or Arabic, or those who have otherwise enabled a suitable preference.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

menu

Returns the receiver’s menu.

- (NSMenu *)menu
Discussion

For NSApplication this menu is the same as the menu returned by its mainMenu method.

Availability
  • Available in OS X v10.0 and later.
See Also
Declared In
NSResponder.h

mouseDown:

Informs the receiver that the user has pressed the left mouse button.

- (void)mouseDown:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the mouse-down event.

Discussion

The default implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.0 and later.
Related Sample Code
Declared In
NSResponder.h

mouseDragged:

Informs the receiver that the user has moved the mouse with the left button pressed.

- (void)mouseDragged:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the mouse-dragged event.

Discussion

The default implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.0 and later.
Related Sample Code
Declared In
NSResponder.h

mouseEntered:

Informs the receiver that the cursor has entered a tracking rectangle.

- (void)mouseEntered:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the mouse-entered event.

Discussion

The default implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

mouseExited:

Informs the receiver that the cursor has exited a tracking rectangle.

- (void)mouseExited:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the mouse-exited event.

Discussion

The default implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

mouseMoved:

Informs the receiver that the mouse has moved.

- (void)mouseMoved:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the mouse-moved event.

Discussion

The default implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.0 and later.
See Also
Declared In
NSResponder.h

mouseUp:

Informs the receiver that the user has released the left mouse button.

- (void)mouseUp:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the mouse-up event.

Discussion

The default implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.0 and later.
Related Sample Code
Declared In
NSResponder.h

moveBackward:

Implemented by subclasses to move the selection or insertion point one element or character backward.

- (void)moveBackward:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

In text, if there is a selection it should be deselected, and the insertion point should be placed at the beginning of the former selection. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveBackwardAndModifySelection:

Implemented by subclasses to expand or reduce either end of the selection backward by one element or character.

- (void)moveBackwardAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If the end being modified is the backward end, this method expands the selection; if the end being modified is the forward end, it reduces the selection. The first moveBackwardAndModifySelection: or moveForwardAndModifySelection: method in a series determines the end being modified by always expanding. Hence, this method results in the backward end becoming the mobile one if invoked first. By default, moveLeftAndModifySelection: is bound to the left arrow key.

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveDown:

Implemented by subclasses to move the selection or insertion point one element or character down.

- (void)moveDown:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

In text, if there is a selection it should be deselected, and the insertion point should be placed below the beginning of the former selection. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveDownAndModifySelection:

Implemented by subclasses to expand or reduce the top or bottom end of the selection downward by one element, character, or line (whichever is appropriate for text direction).

- (void)moveDownAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If the end being modified is the bottom, this method expands the selection; if the end being modified is the top, it reduces the selection. The first moveDownAndModifySelection: or moveUpAndModifySelection: method in a series determines the end being modified by always expanding. Hence, this method results in the bottom end becoming the mobile one if invoked first.

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveForward:

Implemented by subclasses to move the selection or insertion point one element or character forward.

- (void)moveForward:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

In text, if there is a selection it should be deselected, and the insertion point should be placed at the end of the former selection. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveForwardAndModifySelection:

Implemented by subclasses to expand or reduce either end of the selection forward by one element or character.

- (void)moveForwardAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If the end being modified is the backward end, this method reduces the selection; if the end being modified is the forward end, it expands the selection. The first moveBackwardAndModifySelection: or moveForwardAndModifySelection: method in a series determines the end being modified by always expanding. Hence, this method results in the forward end becoming the mobile one if invoked first. By default, moveRightAndModifySelection: is bound to the right arrow key.

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveLeft:

Implemented by subclasses to move the selection or insertion point one element or character to the left.

- (void)moveLeft:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

In text, if there is a selection it should be deselected, and the insertion point should be placed at the left end of the former selection. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveLeftAndModifySelection:

Implemented by subclasses to expand or reduce either end of the selection to the left (display order) by one element or character.

- (void)moveLeftAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If the end being modified is the left end, this method expands the selection; if the end being modified is the right end, it reduces the selection. The first moveLeftAndModifySelection: or moveRightAndModifySelection: method in a series determines the end being modified by always expanding. Hence, this method results in the left end becoming the mobile one if invoked first. By default, this method is bound to the left arrow key.

NSResponder declares but doesn’t implement this method.

The essential difference between this method and the corresponding moveBackwardAndModifySelection: is that the latter method moves in logical order, which can differ in bidirectional text, whereas this method moves in display order.

Availability
  • Available in OS X v10.3 and later.
Declared In
NSResponder.h

moveParagraphBackwardAndModifySelection:

Implemented by subclasses to move the selection or insertion point to the beginning of the previous paragraph, expanding or reducing the current selection.

- (void)moveParagraphBackwardAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If the cursor is already at the beginning of a paragraph, the selection moves backward to the beginning of the previous paragraph.

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

moveParagraphForwardAndModifySelection:

Implemented by subclasses to move the selection or insertion point to the beginning of the next paragraph, expanding or reducing the current selection.

- (void)moveParagraphForwardAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If the cursor is already at the end of a paragraph, the selection moves forward to the end of the next paragraph.

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

moveRight:

Implemented by subclasses to move the selection or insertion point one element or character to the right.

- (void)moveRight:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

In text, if there is a selection it should be deselected, and the insertion point should be placed at the right end of the former selection. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveRightAndModifySelection:

Implemented by subclasses to expand or reduce either end of the selection to the right (display order) by one element or character.

- (void)moveRightAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If the end being modified is the left end, this method reduces the selection; if the end being modified is the right end, it expands the selection. The first moveLeftAndModifySelection: or moveRightAndModifySelection: method in a series determines the end being modified by always expanding. Hence, this method results in the right end becoming the mobile one if invoked first. By default, this method is bound to the right arrow key.

NSResponder declares but doesn’t implement this method.

The essential difference between this method and the corresponding moveForwardAndModifySelection: is that the latter method moves in logical order, which can differ in bidirectional text, whereas this method moves in display order.

Availability
  • Available in OS X v10.3 and later.
Declared In
NSResponder.h

moveToBeginningOfDocument:

Implemented by subclasses to move the selection to the first element of the document or the insertion point to the beginning.

- (void)moveToBeginningOfDocument:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveToBeginningOfDocumentAndModifySelection:

Implemented by subclasses to move the selection or insertion point to the beginning of the document, expanding or reducing the current selection.

- (void)moveToBeginningOfDocumentAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

moveToBeginningOfLine:

Implemented by subclasses to move the selection to the first element of the selected line or the insertion point to the beginning of the line.

- (void)moveToBeginningOfLine:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveToBeginningOfLineAndModifySelection:

Implemented by subclasses to move the selection or insertion point to the beginning of the line, expanding or reducing the current selection.

- (void)moveToBeginningOfLineAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

moveToBeginningOfParagraph:

Implemented by subclasses to move the insertion point to the beginning of the selected paragraph.

- (void)moveToBeginningOfParagraph:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveToBeginningOfParagraphAndModifySelection:

Implemented by subclasses to move the selection or insertion point to the beginning of the current paragraph, expanding or reducing the current selection.

- (void)moveToBeginningOfParagraphAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

moveToEndOfDocument:

Implemented by subclasses to move the selection to the last element of the document or the insertion point to the end.

- (void)moveToEndOfDocument:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveToEndOfDocumentAndModifySelection:

Implemented by subclasses to move the selection or insertion point to the end of the document, expanding or reducing the current selection.

- (void)moveToEndOfDocumentAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

moveToEndOfLine:

Implemented by subclasses to move the selection to the last element of the selected line or the insertion point to the end of the line.

- (void)moveToEndOfLine:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveToEndOfLineAndModifySelection:

Implemented by subclasses to move the selection or insertion point to the end of the line, expanding or reducing the current selection.

- (void)moveToEndOfLineAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

moveToEndOfParagraph:

Implemented by subclasses to move the insertion point to the end of the selected paragraph.

- (void)moveToEndOfParagraph:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveToEndOfParagraphAndModifySelection:

Implemented by subclasses to move the selection or insertion point to the end of the current paragraph, expanding or reducing the current selection.

- (void)moveToEndOfParagraphAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

moveToLeftEndOfLine:

Implemented by subclasses to move the selection or insertion point to the left end of the line.

- (void)moveToLeftEndOfLine:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

In text, if there is a selection it should be deselected, and the insertion point should be placed at left end of the line. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

moveToLeftEndOfLineAndModifySelection:

Implemented by subclasses to move the selection or insertion point to the left end of the line, expanding or contracting the selection as required.

- (void)moveToLeftEndOfLineAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

moveToRightEndOfLine:

Implemented by subclasses to move the selection or insertion point to the right end of the line

- (void)moveToRightEndOfLine:(id)sender
Parameters
sender

Typically the object that invoked this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

moveToRightEndOfLineAndModifySelection:

Implemented by subclasses to move the selection or insertion point to the right end of the line, expanding or contracting the selection as required.

- (void)moveToRightEndOfLineAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

moveUp:

Implemented by subclasses to move the selection or insertion point one element or character up.

- (void)moveUp:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

In text, if there is a selection it should be deselected, and the insertion point should be placed above the beginning of the former selection. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveUpAndModifySelection:

Implemented by subclasses to expand or reduce the top or bottom end of the selection upward by one element, character, or line (whichever is appropriate for text direction).

- (void)moveUpAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If the end being modified is the bottom, this method reduces the selection; if the end being modified is the top, it expands the selection. The first moveDownAndModifySelection: or moveUpAndModifySelection: method in a series determines the end being modified by always expanding. Hence, this method results in the top end becoming the mobile one if invoked first.

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveWordBackward:

Implemented by subclasses to move the selection or insertion point one word backward.

- (void)moveWordBackward:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If there is a selection it should be deselected, and the insertion point should be placed at the end of the first word preceding the former selection. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveWordBackwardAndModifySelection:

Implemented by subclasses to expand or reduce either end of the selection backward by one whole word.

- (void)moveWordBackwardAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If the end being modified is the backward end, this method expands the selection; if the end being modified is the forward end, it reduces the selection. The first moveWordBackwardAndModifySelection: or moveWordForwardAndModifySelection: method in a series determines the end being modified by always expanding. Hence, this method results in the backward end becoming the mobile one if invoked first.

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveWordForward:

Implemented by subclasses to move the selection or insertion point one word forward, in logical order.

- (void)moveWordForward:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If there is a selection it should be deselected, and the insertion point should be placed at the beginning of the first word following the former selection. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveWordForwardAndModifySelection:

Implemented by subclasses to expand or reduce either end of the selection forward by one whole word.

- (void)moveWordForwardAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If the end being modified is the backward end, this method reduces the selection; if the end being modified is the forward end, it expands the selection. The first moveWordBackwardAndModifySelection: or moveWordForwardAndModifySelection: method in a series determines the end being modified by always expanding. Hence, this method results in the forward end becoming the mobile one if invoked first. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

moveWordLeft:

Implemented by subclasses to move the selection or insertion point one word to the left, in display order.

- (void)moveWordLeft:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If there is a selection it should be deselected, and the insertion point should be placed at the end of the first word to the left of the former selection. NSResponder declares but doesn’t implement this method.

The main difference between this method and the corresponding moveWordBackward: method is that the latter moves in logical order, which is important in bidirectional text, whereas this method moves in display order.

Availability
  • Available in OS X v10.3 and later.
Declared In
NSResponder.h

moveWordLeftAndModifySelection:

Implemented by subclasses to expand or reduce either end of the selection left by one whole word in display order.

- (void)moveWordLeftAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If the end being modified is the left end, this method expands the selection; if the end being modified is the right end, it reduces the selection. The first moveWordLeftAndModifySelection: or moveWordRightAndModifySelection: method in a series determines the end being modified by always expanding. Hence, this method results in the left end becoming the mobile one if invoked first.

NSResponder declares but doesn’t implement this method.

The main difference between this method and the corresponding moveWordBackwardAndModifySelection: method is that the latter moves in logical order, which is important in bidirectional text, whereas this method moves in display order.

Availability
  • Available in OS X v10.3 and later.
Declared In
NSResponder.h

moveWordRight:

Implemented by subclasses to move the selection or insertion point one word right.

- (void)moveWordRight:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If there is a selection it should be deselected, and the insertion point should be placed at the beginning of the first word to the right of the former selection. NSResponder declares but doesn’t implement this method.

The main difference between this method and the corresponding moveWordForward: method is that the latter moves in logical order, which is important in bidirectional text, whereas this method moves in display order.

Availability
  • Available in OS X v10.3 and later.
Declared In
NSResponder.h

moveWordRightAndModifySelection:

Implemented by subclasses to expand or reduce either end of the selection to the right by one whole word.

- (void)moveWordRightAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If the end being modified is the backward end, this method reduces the selection; if the end being modified is the forward end, it expands the selection. The first moveWordBackwardAndModifySelection: or moveWordForwardAndModifySelection: method in a series determines the end being modified by always expanding. Hence, this method results in the forward end becoming the mobile one if invoked first. NSResponder declares but doesn’t implement this method.

The main difference between this method and the corresponding moveWordForwardAndModifySelection: method is that the latter moves in logical order, which is important in bidirectional text, whereas this method moves in display order.

Availability
  • Available in OS X v10.3 and later.
Declared In
NSResponder.h

nextResponder

Returns the receiver’s next responder, or nil if it has none.

- (NSResponder *)nextResponder
Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

noResponderFor:

Handles the case where an event or action message falls off the end of the responder chain.

- (void)noResponderFor:(SEL)eventSelector
Parameters
eventSelector

A selector identifying the action or event message.

Discussion

The default implementation beeps if eventSelector is keyDown:.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

otherMouseDown:

Informs the receiver that the user has pressed a mouse button other than the left or right one.

- (void)otherMouseDown:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the mouse-down event.

Discussion

The default implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.1 and later.
Declared In
NSResponder.h

otherMouseDragged:

Informs the receiver that the user has moved the mouse with a button other than the left or right button pressed.

- (void)otherMouseDragged:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the mouse-dragged event.

Discussion

The default implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.1 and later.
Declared In
NSResponder.h

otherMouseUp:

Informs the receiver that the user has released a mouse button other than the left or right button.

- (void)otherMouseUp:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the mouse-up event.

Discussion

The default implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.1 and later.
Declared In
NSResponder.h

pageDown:

Implemented by subclasses to scroll the receiver down (or back) one page in its scroll view, also moving the insertion point to the top of the newly displayed page.

- (void)pageDown:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

pageDownAndModifySelection:

Implemented by subclasses to scroll the receiver down (or back) one page in its scroll view, also moving the insertion point to the top of the newly displayed page. The selection is expanded or contracted as required.

- (void)pageDownAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

pageUp:

Implemented by subclasses to scroll the receiver up (or forward) one page in its scroll view, also moving the insertion point to the top of the newly displayed page.

- (void)pageUp:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

pageUpAndModifySelection:

Implemented by subclasses to scroll the receiver up (or forward) one page in its scroll view, also moving the insertion point to the top of the newly displayed page. The selection is expanded or contracted as necessary.

- (void)pageUpAndModifySelection:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

performKeyEquivalent:

Overridden by subclasses to handle a key equivalent.

- (BOOL)performKeyEquivalent:(NSEvent *)theEvent
Parameters
theEvent

An event object that represents the key equivalent pressed.

Discussion

If the character code or codes in theEvent match the receiver’s key equivalent, the receiver should respond to the event and return YES. The default implementation does nothing and returns NO.

Availability
  • Available in OS X v10.0 and later.
See Also
Declared In
NSResponder.h

performTextFinderAction:

Performs all find oriented actions.

- (void)performTextFinderAction:(id)sender
Parameters
sender

The sender of the find action.

Discussion

When an application performs a find action, it should send this message to the responder chain.

A responder of performTextFinderAction: is responsible for creating and owning an instance of NSTextFinder. Before any other messages are sent to the NSTextFinder, you should set its 'client' property to an object which implements the NSTextFinderClient protocol.

Availability
  • Available in OS X v10.7 and later.
Declared In
NSResponder.h

presentError:

Presents an error alert to the user as an application-modal dialog.

- (BOOL)presentError:(NSError *)anError
Parameters
anError

An object containing information about an error.

Discussion

The alert displays information found in the NSError object anError; this information can include error description, recovery suggestion, failure reason, and button titles (all localized). The method returns YES if error recovery succeeded and NO otherwise. For error recovery to be attempted, an recovery-attempter object (that is, an object conforming to the NSErrorRecoveryAttempting informal protocol) must be associated with anError.

The default implementation of this method sends willPresentError: to self. By doing this, NSResponder gives subclasses an opportunity to customize error presentation. It then forwards the message, passing any customized error object, to the next responder; if there is no next responder, it passes the error object to NSApp, which displays a document-modal error alert. When the user dismisses the alert, any recovery attempter associated with the error object is given a chance to recover from the error. See the class description for the precise route up the responder chain (plus document and controller objects) this message might travel.

It is not recommended that you attempt to override this method. If you wish to customize the error presentation, override willPresentError: instead.

Availability
  • Available in OS X v10.4 and later.
Declared In
NSResponder.h

presentError:modalForWindow:delegate:didPresentSelector:contextInfo:

Presents an error alert to the user as a document-modal sheet attached to document window.

- (void)presentError:(NSError *)error modalForWindow:(NSWindow *)aWindow delegate:(id)delegate didPresentSelector:(SEL)didPresentSelector contextInfo:(void *)contextInfo
Parameters
error

The object encapsulating information about the error.

aWindow

The window object identifying the window owning the document-modal sheet.

delegate

The modal delegate for the sheet.

didPresentSelector

A selector identifying the message to be sent to the modal delegate. The didPresentSelector selector must have the signature:

- (void)didPresentErrorWithRecovery:(BOOL)didRecover
   contextInfo:(void *)contextInfo
contextInfo

Supplemental data to be passed to the modal delegate; can be NULL.

Discussion

The information displayed in the alert is extracted from the NSError object error; it may include a description, recovery suggestion, failure reason, and button titles (all localized). Once the user dismisses the alert and any recovery attempter associated with the error object has had a chance to recover from it, the receiver sends a message identified by didPresentSelector to the modal delegate delegate. (A recovery attempter is an object that conforms to the NSErrorRecoveryAttempting informal protocol.)

The modal delegate implements the method identified by didPresentSelector to perform any post-error processing if recovery failed or was not attempted (that is, didRecover is NO). Any supplemental data is passed to the modal delegate via contextInfo.

The default implementation of this method sends willPresentError: to self. By doing this, NSResponder gives subclasses an opportunity to customize error presentation. It then forwards the message, passing any customized error, to the next responder or; if there is no next responder, it passes the error object to NSApp, which displays a document-modal error alert. When the user dismisses the alert, any recovery attempter associated with the error object is given a chance to recover from the error. See the class description for the precise route up the responder chain (plus document and controller objects) this message might travel.

It is not recommended that you attempt to override this method. If you wish to customize the error presentation, override willPresentError: instead.

Availability
  • Available in OS X v10.4 and later.
Declared In
NSResponder.h

quickLookPreviewItems:

Implemented by subclasses to perform a Quick Look on the text cursor position, selection, or whatever is appropriate for your view.

- (void)quickLookPreviewItems:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If there are no Quick Look items, then send nextResponder a tryToPerform:with: message to pass the request up the responder chain. Eventually AppKit will attempt to perform a dictionary look up.

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.8 and later.
Declared In
NSResponder.h

quickLookWithEvent:

Implemented by subclasses to perform a Quick Look on the content at location in the event.

- (void)quickLookWithEvent:(NSEvent *)event
Parameters
event

An event object containing the location of the Quick Look content.

Discussion

If there are no Quick Look items at the location, call super.

The NSEventTypeQuickLook event type supports this method. The only valid properties of an NSEventTypeQuickLook event are locationInWindow and modifierFlags. A Quick Look event does not come in through the normal event mechanism, therefore there is no corresponding event mask for it, nor should you attempt to look for it in a sendEvent: message or with the nextEventMatchingMask: methods.

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.8 and later.
Declared In
NSResponder.h

resignFirstResponder

Notifies the receiver that it’s been asked to relinquish its status as first responder in its window.

- (BOOL)resignFirstResponder
Discussion

The default implementation returns YES, resigning first responder status. Subclasses can override this method to update state or perform some action such as unhighlighting the selection, or to return NO, refusing to relinquish first responder status.

Use the NSWindow makeFirstResponder: method, not this method, to make an object the first responder. Never invoke this method directly.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

restoreStateWithCoder:

Restores the interface-related state of the responder.

- (void)restoreStateWithCoder:(NSCoder *)coder
Parameters
coder

The coder object to use to restore the responder’s interface-related state.

Discussion

This method is part of the window restoration system and is called at launch time to restore the visual state of your responder object. The default implementation does nothing but specific subclasses (such as NSView and NSWindow) override it and save important state information. Therefore, if you override this method, you should always call super at some point in your implementation.

Subclasses can override this method and use it to restore any information that was saved in the encodeRestorableStateWithCoder: method. You can also use this method to reconfigure the responder to its previous appearance.

For information about using a coder object to read data from an archive, see Archives and Serializations Programming Guide.

Availability
  • Available in OS X v10.7 and later.
Declared In
NSWindowRestoration.h

rightMouseDown:

Informs the receiver that the user has pressed the right mouse button.

- (void)rightMouseDown:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the mouse-down event.

Discussion

The default implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.0 and later.
See Also
Declared In
NSResponder.h

rightMouseDragged:

Informs the receiver that the user has moved the mouse with the right button pressed .

- (void)rightMouseDragged:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the mouse-dragged event.

Discussion

The default implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

rightMouseUp:

Informs the receiver that the user has released the right mouse button.

- (void)rightMouseUp:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the mouse-up event.

Discussion

The default implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

rotateWithEvent:

Informs the receiver that the user has begun a rotation gesture.

- (void)rotateWithEvent:(NSEvent *)event
Parameters
event

An event object representing the rotate gesture.

Discussion

The event will be sent to the view under the touch in the key window.

Availability
  • Available in OS X v10.5 and later.
Declared In
NSResponder.h

scrollLineDown:

Implemented by subclasses to scroll the receiver one line down in its scroll view, without changing the selection.

- (void)scrollLineDown:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
See Also
Declared In
NSResponder.h

scrollLineUp:

Implemented by subclasses to scroll the receiver one line up in its scroll view, without changing the selection.

- (void)scrollLineUp:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
See Also
Declared In
NSResponder.h

scrollPageDown:

Implemented by subclasses to scroll the receiver one page down in its scroll view, without changing the selection.

- (void)scrollPageDown:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
See Also
Declared In
NSResponder.h

scrollPageUp:

Implemented by subclasses to scroll the receiver one page up in its scroll view, without changing the selection.

- (void)scrollPageUp:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
See Also
Declared In
NSResponder.h

scrollToBeginningOfDocument:

Implemented by subclasses to scroll the receiver to the beginning of the document, without changing the selection.

- (void)scrollToBeginningOfDocument:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

scrollToEndOfDocument:

Implemented by subclasses to scroll the receiver to the end of the document, without changing the selection.

- (void)scrollToEndOfDocument:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

scrollWheel:

Informs the receiver that the mouse’s scroll wheel has moved.

- (void)scrollWheel:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the wheel-scrolling event.

Discussion

The default implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

selectAll:

Implemented by subclasses to select all selectable elements.

- (void)selectAll:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

selectLine:

Implemented by subclasses to select all elements in the line or lines containing the selection or insertion point.

- (void)selectLine:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

selectParagraph:

Implemented by subclasses to select all paragraphs containing the selection or insertion point.

- (void)selectParagraph:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

selectToMark:

Implemented by subclasses to select all items from the insertion point or selection to a previously placed mark, including the selection itself if not empty.

- (void)selectToMark:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

selectWord:

Implemented by subclasses to extend the selection to the nearest word boundaries outside it (up to, but not including, word delimiters).

- (void)selectWord:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

setMark:

Implemented by subclasses to set a mark at the insertion point or selection, which is used by deleteToMark: and selectToMark:.

- (void)setMark:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

setMenu:

Sets the receiver’s menu.

- (void)setMenu:(NSMenu *)aMenu
Parameters
aMenu

The menu object to set as the receiver's menu.

Discussion

If the receiver is an NSApplication object, this method sets the main menu, typically set using setMainMenu:.

Availability
  • Available in OS X v10.0 and later.
See Also
Declared In
NSResponder.h

setNextResponder:

Sets the receiver’s next responder.

- (void)setNextResponder:(NSResponder *)aResponder
Parameters
aResponder

An object that inherits, directly or indirectly, from NSResponder.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

shouldBeTreatedAsInkEvent:

Returns YES if the specified event should be treated as an ink event, NO if it should be treated as a mouse event.

- (BOOL)shouldBeTreatedAsInkEvent:(NSEvent *)theEvent
Parameters
theEvent

An event object representing the event to be tested.

Discussion

This method provides the ability to distinguish when a pen-down should start inking versus when a pen-down should be treated as a mouse down event. This allows for a write-anywhere model for pen-based input.

The default implementation in NSApplication sends the method to the NSWindow object under the pen. If the window is inactive, this method returns YES, unless the pen-down is in the window drag region. If the window is active, this method is sent to the NSView object under the pen.

The default implementation in NSView returns YES, and NSControl overrides and returns NO. This allows write-anywhere over most NSView objects, but allows the pen to be used to track in controls and to move windows.

A custom view should override this method to get the correct behavior for a pen-down in the view.

Availability
  • Available in OS X v10.2 and later.
Declared In
NSResponder.h

showContextHelp:

Implemented by subclasses to invoke the help system, displaying information relevant to the receiver and its current state.

- (void)showContextHelp:(id)sender
Parameters
sender

Typically the object that invoked this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

smartMagnifyWithEvent:

Informs the receiver that the user performed a smart zoom gesture.

- (void)smartMagnifyWithEvent:(NSEvent *)event
Parameters
event

An event object representing the smart zoom gesture.

Discussion

The smart zoom gesture is a two-finger double tap on trackpads. In response to this event, you should intelligently magnify the content.

Availability
  • Available in OS X v10.8 and later.
Declared In
NSResponder.h

supplementalTargetForAction:sender:

This method is used in the process of finding a target for an action method.

- (id)supplementalTargetForAction:(SEL)action sender:(id)sender
Parameters
action

The requested action.

sender

The message sender.

Return Value

An object which responds to the action, or nil.

Discussion

If this NSResponder instance does not itself respondsToSelector:, then supplementalTargetForAction:sender: is called.

This method should return an object which responds to the action; if this responder does not have a supplemental object that does that, the implementation of this method should call super's supplementalTargetForAction:sender:.

NSResponder's implementation returns nil.

Availability
  • Available in OS X v10.7 and later.
Declared In
NSResponder.h

swapWithMark:

Swaps the mark and the selection or insertion point, so that what was marked is now the selection or insertion point, and what was the insertion point or selection is now the mark.

- (void)swapWithMark:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
See Also
Declared In
NSResponder.h

swipeWithEvent:

Informs the receiver that the user has begun a swipe gesture.

- (void)swipeWithEvent:(NSEvent *)event
Parameters
event

An event object representing the swipe gesture.

Discussion

The event will be sent to the view under the touch in the key window.

Availability
  • Available in OS X v10.5 and later.
Declared In
NSResponder.h

tabletPoint:

Informs the receiver that a tablet-point event has occurred.

- (void)tabletPoint:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the tablet-point event.

Discussion

Tablet events are represented by NSEvent objects of type NSTabletPoint. They describe the current state of a transducer (that is, a pointing device) that is in proximity to its tablet, reflecting changes such as location, pressure, tilt, and rotation. See the NSEvent reference for the methods that allow you to extract this and other information from theEvent. The default implementation of NSResponder passes the message to the next responder.

Availability
  • Available in OS X v10.4 or later.
Declared In
NSResponder.h

tabletProximity:

Informs the receiver that a tablet-proximity event has occurred.

- (void)tabletProximity:(NSEvent *)theEvent
Parameters
theEvent

An object encapsulating information about the tablet-point event.

Discussion

Tablet events are represented by NSEvent objects of type NSTabletProximity. Tablet devices generate proximity events when the transducer (pointing device) nears a tablet and when it moves away from a tablet. From an event object of this type you can extract information about the kind of device and its capabilities, as well as the relation of this tablet-proximity event to various tablet-point events; see the NSEvent reference for details. The default implementation passes the message to the next responder.

Availability
  • Available in OS X v10.4 or later.
Declared In
NSResponder.h

touchesBeganWithEvent:

Informs the receiver that new set of touches has been recognized.

- (void)touchesBeganWithEvent:(NSEvent *)event
Parameters
event

An event object representing the beginning of a touch.

Discussion

The event will be sent to the view under the touch in the key window. To get the set of touches that began for this view (or descendants of this view) send [event touchesMatchingPhase:NSTouchPhaseBegan inView:self].

This is not always the point of contact with the touch device. A touch that transitions from resting to active may be part of a touchesBeganWithEvent: set.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

touchesCancelledWithEvent:

Informs the receiver that tracking of touches has been cancelled for any reason.

- (void)touchesCancelledWithEvent:(NSEvent *)event
Parameters
event

An event object representing the cancellation of a touch event.

Discussion

The event will be sent to the view under the touch in the key window.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

touchesEndedWithEvent:

Returns that a set of touches have been removed.

- (void)touchesEndedWithEvent:(NSEvent *)event
Parameters
event

An event object representing the ending of a touch event.

Discussion

The event will be sent to the view under the touch in the key window. To get the set of touches that ended for this view (or descendants of this view) send [event touchesMatchingPhase:NSTouchPhaseEnded inView:self].

This is not always the point of removal with the touch device. A touch that transitions from active to resting may be part of an touchesEndedWithEvent: set.

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

touchesMovedWithEvent:

Informs the receiver that one or more touches has moved.

- (void)touchesMovedWithEvent:(NSEvent *)event
Parameters
event

An event object representing a touch movement.

Discussion

The event will be sent to the view under the touch in the key window. To get the set of touches that moved for this view (or descendants of this view) send [event touchesMatchingPhase:NSTouchPhaseMoved inView:self].

Availability
  • Available in OS X v10.6 and later.
Declared In
NSResponder.h

transpose:

Transposes the characters to either side of the insertion point and advances the insertion point past both of them. Does nothing to a selected range of text.

- (void)transpose:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

transposeWords:

Transposes the words to either side of the insertion point and advances the insertion point past both of them. Does nothing to a selected range of text.

- (void)transposeWords:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

tryToPerform:with:

Attempts to perform the action indicated method with a specified argument.

- (BOOL)tryToPerform:(SEL)anAction with:(id)anObject
Parameters
anAction

The selector identifying the action method.

anObject

The object to use as the sole argument of the action method.

Return Value

Returns NO if no responder is found that responds to anAction, YES otherwise.

Discussion

If the receiver responds to anAction, it invokes the method with anObject as the argument and returns YES. If the receiver doesn’t respond, it sends this message to its next responder with the same selector and object.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

undoManager

Returns the undo manager for this responder.

- (NSUndoManager *)undoManager
Discussion

NSResponder’s implementation simply passes this message to the next responder.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

uppercaseWord:

Implemented by subclasses to make uppercase every letter in the word or words surrounding the insertion point or selection, expanding the selection if necessary.

- (void)uppercaseWord:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If either end of the selection partially covers a word, that entire word is made uppercase. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h

validateProposedFirstResponder:forEvent:

Allow controls to determine when they should become first responder.

- (BOOL)validateProposedFirstResponder:(NSResponder *)responder forEvent:(NSEvent *)event
Parameters
responder

The first responder.

event

The event to validate. May be nil if there is no applicable event.

Return Value

YES if the control should become first responder, otherwise NO.

Discussion

Some controls, such as NSTextField, should only become first responder when the enclosing NSTableView/NSBrowser indicates that the view can begin editing. It is up to the particular control that wants to be validated to call this method in its mouseDown: method (or perhaps at another time) to determine if it should attempt to become the first responder or not.

The NSTableView, NSOutlineView, and NSBrowser classes implement this to allow first responder status only if the responder is a view in a selected row. It also delays the first responder assignment if a doubleAction may be invoked.

The default implementation returns YES when there is no nextResponder set, otherwise, it is forwarded up the responder chain.

Availability
  • Available in OS X v10.7 and later.
Declared In
NSResponder.h

validRequestorForSendType:returnType:

Overridden by subclasses to determine what services are available.

- (id)validRequestorForSendType:(NSString *)sendType returnType:(NSString *)returnType
Parameters
sendType

A string identifying the send type of pasteboard data. May be an empty string (see discussion).

returnType

A string identifying the return type of pasteboard data. May be an empty string (see discussion).

Return Value

If the receiver can place data of sendType on the pasteboard and receive data of returnType, it should return self; otherwise it should return either [super validRequestorForSendType:returnType:] or [[self nextResponder] validRequestorForSendType:returnType:], which allows an object higher up in the responder chain to have an opportunity to handle the message.

Discussion

With each event, and for each service in the Services menu, the application object sends this message up the responder chain with the send and return type for the service being checked. This method is therefore invoked many times per event. The default implementation simply forwards this message to the next responder, ultimately returning nil.

Either sendType or returnType—but not both—may be empty. If sendType is empty, the service doesn’t require input from the application requesting the service. If returnType is empty, the service doesn’t return data.

Availability
  • Available in OS X v10.0 and later.
See Also
Declared In
NSResponder.h

wantsForwardedScrollEventsForAxis:

Returns whether to forward elastic scrolling gesture events up the responder.

- (BOOL)wantsForwardedScrollEventsForAxis:(NSEventGestureAxis)axis
Parameters
axis

The gesture axis. See NSEventGestureAxis for the possible values.

Return Value

Returns YES when forward gesture scroll events should be forwarded up the responder chain when the scrolling content is already at the edge of the scrolled direction at the beginning of the scroll gesture; NO otherwise.

Discussion

Some views process gesture scroll events to perform elastic scrolling. In some cases, you may want to track gesture scroll events like a swipe, see, trackSwipeEventWithOptions:usingHandler:.

Implement this method and return YES in your swipe controller and views that perform elastic scrolling will forward gesture scroll events up the responder chain on the following condition: the content to be scrolled is already at the edge of the scrolled direction at the beginning of the scroll gesture.

Otherwise, the view will perform elastic scrolling.

Availability
  • Available in OS X v10.7 and later.
Declared In
NSResponder.h

wantsScrollEventsForSwipeTrackingOnAxis:

Implement this method to track gesture scroll events such as a swipe.

- (BOOL)wantsScrollEventsForSwipeTrackingOnAxis:(NSEventGestureAxis)axis
Parameters
axis

The event gesture axis of the swipe, which defines the scroll direction.

Return Value

YES if gesture scroll events are to be forwarded up the responder chain; otherwise NO. The default implementation returns NO.

Discussion

Implement this method in your swipe controller and return YES to inform views that perform elastic scrolling to forward gesture scroll events up the responder chain. The events are forwarded only on the following condition: the content to be scrolled is already at the edge of the scrolled direction when the scroll gesture begins. Otherwise, the view performs elastic scrolling. The default implementation returns NO.

Availability
  • Available in OS X v10.7 and later.
Declared In
NSResponder.h

willPresentError:

Implemented by subclasses to return a custom version of the supplied error object that is more suitable for presentation in alert sheets and dialogs.

- (NSError *)willPresentError:(NSError *)anError
Parameters
anError

The error object to be customized.

Return Value

The customized error object; if you decide not to customize the error presentation, return by sending this message to super (that is, return [super willPresentError:anError]).

Discussion

When overriding this method, you can examine anError and, if its localized description or recovery information is unhelpfully generic, return an error object with more specific localized text. If you do this, always use the domain and error code of the NSError object to distinguish between errors whose presentation you want to customize and those you do not. Don’t make decisions based on the localized description, recovery suggestion, or recovery options because parsing localized text is problematic.

The default implementation of this method simply returns anError unchanged.

Availability
  • Available in OS X v10.4 and later.
Declared In
NSResponder.h

yank:

Replaces the insertion point or selection with text from the kill buffer.

- (void)yank:(id)sender
Parameters
sender

Typically the object that invoked this method.

Discussion

If invoked sequentially, cycles through the kill buffer in reverse order. See “Standard Action Methods for Selecting and Editing” in Cocoa Event Handling Guide for more information on the kill buffer. NSResponder declares but doesn’t implement this method.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSResponder.h