Assuming there are still outstanding strong references, does this result in a leak because nobody (neither ARC nor I) is managing the object anymore?
CFTypeRef cf_object = CFBridgingRetain(arc_object);
// do stuff
CFRelease(cf_object);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To answer your question, the above code looks fine. You need to do a
CFReleasewhen you are doing a CFCreate,RetainorCopy. As Rob suggested you can also look into the usage ofCFBridgingRelease. For more details related to the ARC changes, you can look into this Raywenderlich tutorial.As per apple documentation of
CFBridgingRetain,Here you need to release the
cf_objectwhich ARC wont take care of it. Once you callCFRelease, it will be released.Documentation on
CFBridgingReleaseNote that when you use
CFBridgingRelease, it will transfer the ownership to ARC and ARC will manage it.For eg:-
ARC will manage
namehere.