This is what I currently do:
Basically I have these 2 rules when doing bridging
Convert from CF land to NS land, use CFBridgingRelease Convert from NS land to CF land, use __bridge.
I've never seen a sample code from apple doing it differently.
Here is a sample:
ABRecordRef ABWhatIsThis= (__bridge ABRecordRef)([self.allMyContacts objectAtIndex:indexPath.row]);
NSString * strName= CFBridgingRelease (ABRecordCopyCompositeName (ABWhatIsThis));
The reasoning is when I want to convert something from NS land to CF land, I do not want to change ownership. The ARC will maintain retain count on the NS land and keep the object in the CF land alive till it's NS land counter part is destroyed.
That's why I used ABRecordRef ABWhatIsThis= (__bridge ABRecordRef)
If I convert something from CF land to NS land, I will use CFBridgingRelease. The reasoning is that once I got an ARC object pointing to the CFBridging, I would not to have CFBridging to retain the stuff.
However, I am still confused. Is there a hard rule when I should use CFBridgingRelease?
Also I noticed there is no such thing as CFBridging. Only CFBridgingRelease and CFBridgingRetain. I wonder why the imbalance.