Function

CFBridgingRelease

Moves a non-Objective-C pointer to Objective-C and also transfers ownership to ARC.

Declaration

id CFBridgingRelease(CFTypeRef X);

Discussion

You use this function to cast a Core Foundation-style object as an Objective-C object and transfer ownership of the object to ARC such that you don’t have to release the object, as illustrated in this example:

CFStringRef cfName = ABRecordCopyValue(person, kABPersonFirstNameProperty);
NSString *name = (NSString *)CFBridgingRelease(cfName);

See Also

Core Foundation ARC Integration

CFBridgingRetain

Casts an Objective-C pointer to a Core Foundation pointer and also transfers ownership to the caller.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software