Instance Method

insertAttributedString:atIndex:

Inserts the characters and attributes of the given attributed string into the receiver at the given index.

Declaration

- (void)insertAttributedString:(NSAttributedString *)attrString atIndex:(NSUInteger)loc;

Parameters

attributedString

The string whose characters and attributes are inserted.

index

The index at which the characters and attributes are inserted.

Discussion

The new characters and attributes begin at the given index and the existing characters and attributes from the index to the end of the receiver are shifted by the length of the attributed string. Raises an NSRangeException if index lies beyond the end of the receiver’s characters.

See Also

Changing characters and attributes

- appendAttributedString:

Adds the characters and attributes of a given attributed string to the end of the receiver.

- replaceCharactersInRange:withAttributedString:

Replaces the characters and attributes in a given range with the characters and attributes of the given attributed string.

- setAttributedString:

Replaces the receiver’s entire contents with the characters and attributes of the given attributed string.