When I think of ARC, there is no release exemption.
I assume that you mean "I do not need to worry about the release." Often there are some performance overheads, although the compiler may someday optimize it.
Although ARC rules are different for NS .. and CF .., is there any specific reason for abandoning CF .. in ARC?
Many Core Foundation objects are managed by ARC, and their number is increasing. You can determine if a particular ARC function supports by looking at the header for CF_IMPLICIT_BRIDGING_ENABLED . If you see this, the functions return ARC-compliant CF objects. In iOS 8, for example, many Core Graphics features were added to the list. (I donโt want to exaggerate, Iโm not saying that you donโt have CFRelease today. Iโm saying that they are configured to manage ARC, they are managed by ARC in Swift, and ultimately they can be processed directly in ObjC without the need for CFRelease . )
The reason that CF objects are not managed by default is because someone had to go through a check (revision) so that each function complies with the Create Rule naming conventions or that they are properly annotated for their exceptions. This is a rather tedious job, and Apple has extended it to several releases. But you should see that over time things get better and better.
Kazuki is right that you cannot put ARC objects in a structure or union, but that usually does not affect the Core Foundation.
BTW, CF_IMPLICIT_BRIDGING_ENABLED is just a wrapper around the pragma arc_cf_code_audited clang. This is explained in the ARC docs, 7.8.1 Listening to C stored pointer interfaces .
Rob napier
source share