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

NSMutableAttributedString — Mac OS X 10.0

Synopsis

NSMutableAttributedString is a subclass of NSAttributedString that allows the contents and attributes of the string to be altered after the object has been initialized, which is normally not possible with its immutable superclass.

image with no caption

@interface NSMutableAttributedString : NSAttributedString
                                  // Accessor Methods
   - (void)setAttributes:(NSDictionary *)attrs 
                                 range:(NSRange)range;
   - (void)setAlignment:(NSTextAlignment)alignment 
                                 range:(NSRange)range;
   - (void)setAttributedString:(NSAttributedString *)attrString;
                                  // Instance Methods
   - (void)appendAttributedString:(NSAttributedString *)attrString;
   - (void)addAttribute:(NSString *)name 
                                 value:(id)value 
                                 range:(NSRange)range;
   - (void)addAttributes:(NSDictionary *)attrs 
                                 range:(NSRange)range;
   - (void)applyFontTraits:(NSFontTraitMask)traitMask 
                                 range:(NSRange)range;
   - (void)beginEditing;
   - (void)deleteCharactersInRange:(NSRange)range;
   - (void)endEditing;
   - (void)fixAttachmentAttributeInRange:(NSRange)range;
   - (void)fixAttributesInRange:(NSRange)range;
   - (void)fixFontAttributeInRange:(NSRange)range;
   - (void)fixParagraphStyleAttributeInRange:(NSRange)range;
   - (void)insertAttributedString:(NSAttributedString *)attrString 
                                 atIndex:(unsigned)loc;
   - (NSMutableString *)mutableString;
   - (BOOL)readFromURL:(NSURL *)url 
                                 options:(NSDictionary *)options 
                                 documentAttributes ...

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