Name

NSTextInput — Mac OS X 10.0

Synopsis

This protocol declares the methods that text view classes should implement to interface with Cocoa’s input management system. In the Application Kit, NSText and NSTextView implement the methods of this protocol.

@protocol NSTextInput
                                  // Instance Methods
   - (void)insertText:(id)aString;
   - (void)doCommandBySelector:(SEL)aSelector;
   - (void)setMarkedText:(id)aString 
                                 selectedRange:(NSRange)selRange;
   - (void)unmarkText;
   - (BOOL)hasMarkedText;
   - (long)conversationIdentifier;
   - (NSAttributedString *)attributedSubstringFromRange:(NSRange)theRange;
   - (NSRange)markedRange;
   - (NSRange)selectedRange;
   - (NSRect)firstRectForCharacterRange:(NSRange)theRange;
   - (unsigned int)characterIndexForPoint:(NSPoint)thePoint;
   - (NSArray*)validAttributesForMarkedText;
@end

Get Cocoa in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.