Releasing Core Foundation object references

后端 未结 5 1639
耶瑟儿~
耶瑟儿~ 2021-01-31 19:21

Do I need to release a Core Foundation objects to clear up memory? And if so, how?

For example, in the code:

ABAddressBookRef addressBook = ABAddressBook         


        
5条回答
  •  感动是毒
    2021-01-31 19:52

    Another small point that no-one has mentioned yet, some CF classes have a "toll-free bridge" with their NS counterpart. CFString and NSString, CFArray and NSArray are both examples. This is relevant as you can just use release with these classes.

    See this other StackOverflow question for more information.

提交回复
热议问题