As stated in the documentation, CFSTR()
created lines remain valid until the program terminates. You can release them all day, but they will not actually be released. For this reason, there is no need to explicitly save / free them. It is true to save / release them, because otherwise you could not pass them through another code that saves / releases them (structure methods, etc.). Treat them as if you created NSString literals created using @""
, that is, you do not need to save or release them after creation, but if you write code that can accept any CFString, you need to follow the normal rules for memory management , including the use of CFRetain()
and CFRelease()
.
source share