CoreFoundation API do not use ARC. The SecItemCopyMatching(,) function returns an owning reference to the CFTypeRef it passes back. By using __bridge_transfer instead of __bridge, the pointer is bridged to an Objective-C object and then its memory is managed by ARC.
Local variable pointers to CoreFoundation objects do not appear to be set to NULL by default, unlike Objective-C pointers when ARC is enabled. As a precaution, the initial value of those variables is set to NULL.
CoreFoundation API do not use ARC. The SecItemCopyMatching(,) function returns an owning reference to the CFTypeRef it passes back. By using
__bridge_transfer
instead of__bridge
, the pointer is bridged to an Objective-C object and then its memory is managed by ARC.Local variable pointers to CoreFoundation objects do not appear to be set to
NULL
by default, unlike Objective-C pointers when ARC is enabled. As a precaution, the initial value of those variables is set toNULL
.See: