NSAttributedString — Mac OS X 10.0
This class represents a string with associated attributes that
describe the styled appearance of the string.
are stored in a dictionary. Cocoa defines several keys to identify
common attributes such as the font, foreground color, text alignment,
line spacing, and more; these keys are listed below in the constants.
This class has many methods for querying the attributes of ranges of
text within the string. For example, the method
attributesAtIndex:effectiveRange: returns a
dictionary of attributes for the character at index, and by reference
the range that the attribute applies to is returned in the second
The Application Kit implements many extensions to
NSAttributedString to support more graphical uses
of this class. In particular, the AppKit extensions provide support
for initializing an attributed string with RTF-formatted data, as
well as converting an attributed string to such data. Additionally,
these extensions provide for drawing attributed strings into a view,
and for managing graphics attributes such as font and ruler
NSAttributedString is an immutable class.
Mutability is supported in the subclass
@interface NSAttributedString : NSObject <NSCoding, NSCopying, NSMutableCopying>
- (id)initWithAttributedString:(NSAttributedString *)attrStr ...