Function

CFAttributedStringGetAttribute

Returns the value of a given attribute of an attributed string at a specified location.

Declaration

CFTypeRef CFAttributedStringGetAttribute(CFAttributedStringRef aStr, CFIndex loc, CFStringRef attrName, CFRange *effectiveRange);

Parameters

str

The attributed string to examine.

loc

The location in str at which to determine the attributes. loc must not exceed the bounds of str.

attrName

The name of the attribute whose value you want to determine.

effectiveRange

If not NULL, upon return contains a range including loc over which exactly the same set of attributes apply as at loc.

Return Value

The value of the specified attribute at the specified location in str. Ownership follows the The Get Rule.

Discussion

For performance reasons, a range returned in effectiveRange is not necessarily the maximal range. If you need the maximum range, you should use CFAttributedStringGetAttributeAndLongestEffectiveRange.

See Also

Accessing Attributes

CFAttributedStringGetAttributes

Returns the attributes of an attributed string at a specified location.

CFAttributedStringGetAttributeAndLongestEffectiveRange

Returns the value of a given attribute of an attributed string at a specified location.

CFAttributedStringGetAttributesAndLongestEffectiveRange

Returns the attributes of an attributed string at a specified location.