Instance Method

fixAttributesInRange:

Cleans up font, paragraph style, and attachment attributes within the given range.

Declaration

- (void)fixAttributesInRange:(NSRange)range;

Parameters

range

The character range within which to fix attributes. Raises an NSRangeException if any part of range lies beyond the end of the receiver’s characters.

Discussion

Removes attachment attributes assigned to characters other than NSAttachmentCharacter, assigns default fonts to characters with illegal fonts for their scripts and otherwise corrects font attribute assignments, and assigns the first paragraph style attribute value in each paragraph to all characters of the paragraph.

This method extends the range as needed to cover the last paragraph partially contained.

Raises an NSRangeException if any part of aRange lies beyond the end of the receiver’s characters.

NSTextStorage subclasses that return YES from the fixesAttributesLazily method should avoid directly calling fixAttributesInRange: or else bracket such calls with beginEditing and endEditing messages.

See Also

Fixing attributes after changes

fixAttachmentAttributeInRange:

Cleans up attachment attributes in aRange, removing all attachment attributes assigned to characters other than NSAttachmentCharacter.

fixFontAttributeInRange:

Fixes the font attribute in aRange, assigning default fonts to characters with illegal fonts for their scripts and otherwise correcting font attribute assignments.

fixParagraphStyleAttributeInRange:

Fixes the paragraph style attributes in aRange, assigning the first paragraph style attribute value in each paragraph to all characters of the paragraph.