[MacRuby-devel] CFRange (Boxed) elements not accessible

Laurent Sansonetti lsansonetti at apple.com
Mon May 31 18:49:06 PDT 2010


On May 31, 2010, at 6:42 PM, Paul Howson wrote:

> On 31/05/2010, at 6:12 PM, Laurent Sansonetti wrote:
> 
>>> Any other suggestions for getting around this bug?
>> 
>> It is possible to fix the problem by manually editing the file.
>> 
>> /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreText.framework/Resources/BridgeSupport/CoreText.bridgesupport
>> 
>> Then, locate the description of CTLineGetStringRange. It should be something like:
>> 
>> <function name='CTLineGetStringRange'>
>> <arg type='^{__CTLine=}'/>
>> <retval type64='{?=qq}' type='{?=ii}'/>
>> </function>
>> 
>> And replace with:
>> 
>> <function name='CTLineGetStringRange'>
>> <arg type='^{__CTLine=}'/>
>> <retval type64='{_CFRange=qq}' type='{_CFRange=ii}'/>
>> </function>
>> 
>> I understand that editing the file manually is probably not an option if you intend to ship the project later, but I think we can add a fix in trunk to expose the fields. We can maybe find another workaround if needed.
> 
> Editing the file fixed the problem. By the time I'm ready to ship something, these changes will have percolated through the system I'm sure.


Good :) Otherwise, it might be possible to convert the object to a real CFRange by doing:

NSRangeFromString(NSStringFromRange(obj))

(This is untested but I suspect it might work...)

Laurent


More information about the MacRuby-devel mailing list