Creates an attributed string with specified string and attributes.
- iOS 2.0+
- macOS 10.4+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Foundation
The allocator to use to allocate memory for the new attributed string. Pass
kto use the current default allocator.
A string that specifies the characters to use in the new attributed string. This value is copied.
A dictionary that contains the attributes to apply to the new attributed string. This value is copied.
An attributed string that contains the characters from
str and the attributes specified by
attributes. The result is
NULL if there was a problem in creating the attributed string. Ownership follows the The Create Rule.
Note that both the string and the attributes dictionary are copied. The specified attributes are applied to the whole string. If you want to apply different attributes to different ranges of the string, you should use a mutable attributed string.