Instance Method


Returns an attributed string derived from the given range in the receiver's text storage.



- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)range actualRange:(NSRangePointer)actualRange;



The range in the text storage from which to create the returned string.


The actual range of the returned string if it was adjusted, for example, to a grapheme cluster boundary or for performance or other reasons. NULL if range was not adjusted.

Return Value

The string created from the given range. May return nil.


An implementation of this method should be prepared for aRange to be out of bounds. For example, the InkWell text input service can ask for the contents of the text input client that extends beyond the document’s range. In this case, you should return the intersection of the document’s range and aRange. If the location of aRange is completely outside of the document’s range, return nil.

See Also

Storing Text

- insertText:replacementRange:

Inserts the given string into the receiver, replacing the specified content.