Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSAttributedStringMBS class.
NSAttributedStringMBS.AsCFAttributedString as Variant
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Text | MBS MacBase Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
For passing to functions which need a CFAttributedStringMBS.
Some examples using this method:
NSAttributedStringMBS.attributeAtIndex(name as string, location as UInt64) as Variant
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
name: The name of an attribute.
location: The index for which to return attributes. This value must not exceed the bounds of the receiver.
effectiveRange: Optional. If the named attribute exists at index, upon return aRange contains a range over which the named attribute's value applies. If the named attribute does not exist at index, upon return aRange contains the range over which the attribute does not exist.
The range isn't necessarily the maximum range covered by attributeName, and its extent is implementation-dependent. If you need the maximum range, use the other variant of this method.
Returns the value for the attribute named attributeName of the character at index index, or nil if there is no such attribute.
Raises an NSRangeException if index lies beyond the end of the receiver's characters.
For information about where to find the attribute keys for the returned dictionary, see the overview section of this document.
See also:
Some examples using this method:
NSAttributedStringMBS.attributeAtIndex(name as string, location as UInt64, inRange as NSRangeMBS) as Variant
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
name: The name of an attribute.
location: The index at which to test for attributeName.
longestEffectiveRange: Optional. If the named attribute exists at index, upon return aRange contains the full range over which the value of the named attribute is the same as that at index, clipped to rangeLimit. If the named attribute does not exist at index, upon return aRange contains the full range over which the attribute does not exist, clipped to rangeLimit.
inRange: The range over which to search for continuous presence of attributeName. This value must not exceed the bounds of the receiver.
Returns the value for the attribute named attributeName of the character at index, or nil if there is no such attribute.
Raises an NSRangeException if index or any part of rangeLimit lies beyond the end of the receiver's characters.
If you don't need the longest effective range, it's far more efficient to use the other variant method to retrieve the attribute value.
For information about where to find the attribute keys for the returned dictionary, see the overview section of this document.
See also:
NSAttributedStringMBS.attributeAtIndex2(name as string, location as UInt64, byref effectiveRange as NSRangeMBS) as Variant
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
name: The name of an attribute.
location: The index for which to return attributes. This value must not exceed the bounds of the receiver.
effectiveRange: Optional. If the named attribute exists at index, upon return aRange contains a range over which the named attribute's value applies. If the named attribute does not exist at index, upon return aRange contains the range over which the attribute does not exist.
The range isn't necessarily the maximum range covered by attributeName, and its extent is implementation-dependent. If you need the maximum range, use the other variant of this method.
Returns the value for the attribute named attributeName of the character at index index, or nil if there is no such attribute.
Raises an NSRangeException if index lies beyond the end of the receiver's characters.
For information about where to find the attribute keys for the returned dictionary, see the overview section of this document.
See also:
NSAttributedStringMBS.attributeAtIndex2(name as string, location as UInt64, byref longestEffectiveRange as NSRangeMBS, inRange as NSRangeMBS) as Variant
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
name: The name of an attribute.
location: The index at which to test for attributeName.
longestEffectiveRange: Optional. If the named attribute exists at index, upon return aRange contains the full range over which the value of the named attribute is the same as that at index, clipped to rangeLimit. If the named attribute does not exist at index, upon return aRange contains the full range over which the attribute does not exist, clipped to rangeLimit.
inRange: The range over which to search for continuous presence of attributeName. This value must not exceed the bounds of the receiver.
Returns the value for the attribute named attributeName of the character at index, or nil if there is no such attribute.
Raises an NSRangeException if index or any part of rangeLimit lies beyond the end of the receiver's characters.
If you don't need the longest effective range, it's far more efficient to use the other variant method to retrieve the attribute value.
For information about where to find the attribute keys for the returned dictionary, see the overview section of this document.
See also:
NSAttributedStringMBS.attributedSubstringFromRange(range as NSRangeMBS) as NSAttributedStringMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Range: The range from which to create a new attributed string. aRange must lie within the bounds of the receiver.
Returns an NSAttributedString object consisting of the characters and attributes within aRange in the receiver.
Raises an NSRangeException if any part of aRange lies beyond the end of the receiver's characters. This method treats the length of the string as a valid range value that returns an empty string.
NSAttributedStringMBS.attributesAtIndex(location as UInt64) as dictionary
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
location: The index for which to return attributes. This value must lie within the bounds of the receiver.
Range: Optional. Upon return, the range over which the attributes and values are the same as those at index. This range isn't necessarily the maximum range covered, and its extent is implementation-dependent. If you need the maximum range, use other variant of this method.
Returns the attributes for the character at index.
Raises an NSRangeException if index lies beyond the end of the receiver's characters.
See also:
Some examples using this method:
NSAttributedStringMBS.attributesAtIndex(location as UInt64, inRange as NSRangeMBS) as dictionary
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
location: The index for which to return attributes. This value must not exceed the bounds of the receiver.
range: Optional. Upon return contains the maximum range over which the attributes and values are the same as those at index, clipped to range Limit.
inRange: The range over which to search for continuous presence of the attributes at index. This value must not exceed the bounds of the receiver.
Raises an NSRangeException if index or any part of rangeLimit lies beyond the end of the receiver's characters.
If you don't need the range information, it's far more efficient to use the other variant of this method to retrieve the attribute value.
For information about where to find the attribute keys for the returned dictionary, see the overview section of this document.
See also:
NSAttributedStringMBS.attributesAtIndex2(location as UInt64, byref range as NSRangeMBS) as dictionary
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
location: The index for which to return attributes. This value must lie within the bounds of the receiver.
Range: Optional. Upon return, the range over which the attributes and values are the same as those at index. This range isn't necessarily the maximum range covered, and its extent is implementation-dependent. If you need the maximum range, use other variant of this method.
Returns the attributes for the character at index.
Raises an NSRangeException if index lies beyond the end of the receiver's characters.
See also:
NSAttributedStringMBS.attributesAtIndex2(location as UInt64, byref range as NSRangeMBS, inRange as NSRangeMBS) as dictionary
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Text | MBS MacBase Plugin | 12.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
location: The index for which to return attributes. This value must not exceed the bounds of the receiver.
range: Optional. Upon return contains the maximum range over which the attributes and values are the same as those at index, clipped to range Limit.
inRange: The range over which to search for continuous presence of the attributes at index. This value must not exceed the bounds of the receiver.
Raises an NSRangeException if index or any part of rangeLimit lies beyond the end of the receiver's characters.
If you don't need the range information, it's far more efficient to use the other variant of this method to retrieve the attribute value.
For information about where to find the attribute keys for the returned dictionary, see the overview section of this document.
See also:
The items on this page are in the following plugins: MBS MacBase Plugin.