Using Arc can help us reduce a lot of memory management burden, especially when we use JavaProgramPersonnel. However, I am not a strong Java Foundation. After two years of development, IOS has become accustomed to manual memory management, and arc is often used to hitting the wall.
Recently we encountered the problem of cfobject and nsobject conversion. Because arc cannot manage the lifecycle of core Foundation objects, we need to use _ bridge between core Foundation and arc, __bridge_retained and _ bridge_transfer conversion keywords.
According to Apple's official documentation (https://developer.apple.com/library/ios/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html ):
_ Bridge only performs type conversion, but does not modify the object (memory) management right;
_ Bridge_retained (you can also use cfbridgingretain) to convert an objective-C object to a core Foundation object, and assign the object (memory) management right to us, cfrelease or related methods will be used to release objects in the future;
_ Bridge_transfer (cfbridgingrelease can also be used) converts the core foundation object to an objective-C object, and grants the object (memory) Management Right to arc.