On Oct 15, 2011, at 11:42 PM, Quincey Morris wrote:

> Use '(__bridge_transfer NSString *)'. You're transferring ownership via 'axb' 
> to ownership via 'myString', if that makes any sense.
> 
> ARC uses horribly ambiguous terminology here:

This is one of the reasons we added the CFBridgingRetain and CFBridgingRelease 
functions to wrap the typecasts.

You use CFBridgingRetain to convert an object that is managed via ARC to one 
that is managed manually, and CFBridgingRelease to do the opposite.

So you write "CFStringRef cfString = CFBridgingRetain(nsString)" to get an 
owning reference to an NSString as a CFString.
And you write "NSString *nsString = CFBridgingRelease(cfString);" to get an ARC 
managed reference of a CFString as an NSString.
--
David Duncan

_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to