| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in Mac OS X v10.6 and later. |
| Companion guide | |
| Declared in | NSText.h |
The NSTextDelegate protocol defines the optional methods implemented by delegates of NSText objects.
Informs the delegate that the text object has begun editing (that the user has begun changing it).
- (void)textDidBeginEditing:(NSNotification *)aNotification
The name of aNotification is NSTextDidBeginEditingNotification.
NSText.hInforms the delegate that the text object has changed its characters or formatting attributes.
- (void)textDidChange:(NSNotification *)aNotification
The name of aNotification is NSTextDidChangeNotification.
NSText.hInforms the delegate that the text object has finished editing (that it has resigned first responder status).
- (void)textDidEndEditing:(NSNotification *)aNotification
The name of aNotification is NSTextDidEndEditingNotification.
NSText.hInvoked when a text object begins to change its text, this method requests permission for aTextObject to begin editing.
- (BOOL)textShouldBeginEditing:(NSText *)aTextObject
If the delegate returns YES, the text object proceeds to make changes. If the delegate returns NO, the text object abandons the editing operation. This method is also invoked when the user drags and drops a file onto the text object.
– makeFirstResponder: (NSWindow)– becomeFirstResponder (NSResponder)NSText.hInvoked from a text object’s implementation of resignFirstResponder, this method requests permission for aTextObject to end editing.
- (BOOL)textShouldEndEditing:(NSText *)aTextObject
If the delegate returns YES, the text object proceeds 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.
– resignFirstResponder (NSResponder)NSText.hLast updated: 2009-06-02