Function

CFAttributedStringSetAttributes

Sets the value of attributes of a mutable attributed string over a specified range.

Declaration

void CFAttributedStringSetAttributes(CFMutableAttributedStringRef aStr, CFRange range, CFDictionaryRef replacement, Boolean clearOtherAttributes);

Parameters

aStr

The mutable attributed string to modify.

range

The range of aStr over to which the new attributes apply. range must not exceed the bounds of aStr.

replacement

A dictionary that contains key-value pairs that specify the new attributes to apply to range. The keys must be CFString objects, and the corresponding values must be CFType objects.

clearOtherAttributes

If false, existing attributes (that aren’t being replaced) are left alone; otherwise they are cleared.

Discussion

Note that after this call, if it is mutable, changes to replacement will not affect the contents of the attributed string.

See Also

Modifying a CFMutableAttributedString

CFAttributedStringBeginEditing

Defers internal consistency-checking and coalescing for a mutable attributed string.

CFAttributedStringEndEditing

Re-enables internal consistency-checking and coalescing for a mutable attributed string.

CFAttributedStringGetMutableString

Gets as a mutable string the string for an attributed string.

CFAttributedStringRemoveAttribute

Removes the value of a single attribute over a specified range.

CFAttributedStringReplaceString

Modifies the string of an attributed string.

CFAttributedStringReplaceAttributedString

Replaces the attributed substring over a range with another attributed string.

CFAttributedStringSetAttribute

Sets the value of a single attribute over the specified range.