On Dec 14, 2010, at 9:58 AM, Matt Neuburg wrote:

> I recognize that the conversion is not simple, but that is exactly why I am 
> surprised that the frameworks do not supply a utility conversion method. If I 
> were to write my own I would surely get it wrong.


The size & layout of the members is the same on 32-bit and 64-bit. But the "not 
found" values are different, so, you can't use any vile casting to reinterpret. 
But a macro to convert is pretty simple:

#define NSMakeRangeFromCF(cfr) NSMakeRange( cfr.location == kCFNotFound ? 
NSNotFound : cfr.location, cfr.length )

-- 
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to