Instance Method

setAttributedText:

Sets the label text to the specified attributed string.

Declaration

- (void)setAttributedText:(NSAttributedString *)attributedText;

Parameters

attributedText

The formatted text string to be displayed in the label. Specifying nil clears the current text from the label.

Discussion

This method changes the label text to the new value, replacing the old text if any. Any font and style attributes applied to the string take precedence over default values. If you do not explicitly specify font or styling information, the default values are used instead. For example, if you do not specify a text color explicitly, the default text color is used.

Attributed strings may not contain any NSTextAttachment objects as part of their content.

See Also

Setting the Label Text

- setText:

Sets the label text to the specified string.

- setTextColor:

Sets the color to apply to plain text strings.