Releasing Core Foundation object references

后端 未结 5 1538
耶瑟儿~
耶瑟儿~ 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 20:04

    I would suggest reading Apple's guide on Core Foundation memory management for an in-depth discussion of this. They have a similar guide for general Cocoa memory management as well.

    To release a CF object, you would call the CFRelease function.

提交回复
热议问题