O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSTextView — Mac OS X 10.0

Synopsis

This class is the frontend class to Cocoa’s text-manipulation architecture. For most purposes, programmers can use this class to interface with the text system; however, if more control is desired, than they may work with the individual component classes of the text system, which are NSTextStorage, NSTextContainer, NSLayoutManager, and this class. In terms of the Model-View-Controller pattern, NSTextStorage is the model, NSTextView is the view, and NSLayoutManager and NSTextContainer serve as controllers for the data layer and the view layer.

image with no caption

@interface NSTextView : NSText <NSTextInput>
                                  // Initializers
   - (id)initWithFrame:(NSRect)frameRect;
   - (id)initWithFrame:(NSRect)frameRect 
                                 textContainer:(NSTextContainer *)container;
                                  // Accessor Methods
   - (void)setImportsGraphics:(BOOL)flag;
   - (BOOL)importsGraphics;
   - (void)setBackgroundColor:(NSColor *)color;
   - (NSColor *)backgroundColor;
   - (void)setAcceptsGlyphInfo:(BOOL)flag;
   - (BOOL)acceptsGlyphInfo;
   - (void)setSelectable:(BOOL)flag;
   - (void)setUsesRuler:(BOOL)flag;
   - (BOOL)usesRuler;
   - (void)setRulerVisible:(BOOL)flag;
   - (void)setRichText:(BOOL)flag;
   - (void)setTypingAttributes:(NSDictionary *)attrs;
   - (NSDictionary *)typingAttributes;
   - (void)setMarkedTextAttributes:(NSDictionary *)attributeDictionary;
   - (NSDictionary *)markedTextAttributes;
   - (void)setAlignment ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required