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.