- Inherits from:
- NSAttributedString : NSObject
- Conforms to:
- NSCoding
- (NSAttributedString)
- NSCopying (NSAttributedString)
- NSMutableCopying (NSAttributedString)
- NSObject (NSObject)
Declared in:
- Foundation/NSAttributedString.h
NSMutableAttributedString declares the programmatic interface to objects that manage mutable attributed strings. You can add and remove characters (raw strings) and attributes separately, or together as attributed strings. See NSAttributedString's class description for more information about attributed strings.
When working with the Application Kit, you must also clean up changed attributes using the various fix... methods. See the Application Kit's specification for this class cluster for more information on fixing attributes.
NSMutableAttributedString adds two primitive methods to those of NSAttributedString. These primitive methods provide the basis for all the other methods in its class. The primitive replaceCharactersInRange:withString: method replaces a range of characters with those from a string, leaving all attribute information outside that range intact. The primitive setAttributes:range: method sets attributes and values for a given range of characters, replacing any previous attributes and values for that range.
- Retrieving character information
- - mutableString
- Changing characters
- - replaceCharactersInRange:withString:
- - deleteCharactersInRange:
- Changing attributes
- - setAttributes:range:
- - addAttribute:value:range:
- - addAttributes:range:
- - removeAttribute:range:
- Changing characters and attributes
- - appendAttributedString:
- - insertAttributedString:atIndex:
- - replaceCharactersInRange:withAttributedString:
- - setAttributedString:
- Grouping changes
- - beginEditing
- - endEditing
- (void)addAttribute:(NSString
*)name
value:(id)value
range:(NSRange)aRange
nil
,
and an NSRangeException if any part of aRange lies
beyond the end of the receiver's characters.See Also: - addAttributes:range:, - removeAttribute:range:
- (void)addAttributes:(NSDictionary
*)attributes
range:(NSRange)aRange
nil
and
an NSRangeException if any part of aRange lies
beyond the end of the receiver's characters.See Also: - addAttribute:value:range:, - removeAttribute:range:
- (void)appendAttributedString:(NSAttributedString
*)attributedString
See Also: - insertAttributedString:atIndex:, + attributedStringWithAttachment: (NSAttributedString Additions in the Application Kit)
- (void)beginEditing
- (void)deleteCharactersInRange:(NSRange)aRange
See Also: - replaceCharactersInRange:withAttributedString:, - replaceCharactersInRange:withString:
- (void)endEditing
See Also: - processEditing (NSTextStorage class in the Application Kit)
- (void)insertAttributedString:(NSAttributedString
*)attributedString
atIndex:(unsigned)index
See Also: - appendAttributedString:, + attributedStringWithAttachment: (NSAttributedString Additions in the Application Kit)
- (NSMutableString *)mutableString
- (void)removeAttribute:(NSString
*)name
range:(NSRange)aRange
See Also: - addAttribute:value:range:, - addAttributes:range:
- (void)replaceCharactersInRange:(NSRange)aRange
withAttributedString:(NSAttributedString
*)attributedString
See Also: - insertAttributedString:atIndex:
- (void)replaceCharactersInRange:(NSRange)aRange
withString:(NSString *)aString
Raises an NSRangeException if any part of aRange lies beyond the end of the receiver's characters.
See Also: - deleteCharactersInRange:
- (void)setAttributedString:(NSAttributedString
*)attributedString
See Also: - appendAttributedString:
- (void)setAttributes:(NSDictionary
*)attributes
range:(NSRange)aRange
See Also: - addAttributes:range:, - removeAttribute:range: