Releasing Core Foundation object references

后端 未结 5 1539
耶瑟儿~
耶瑟儿~ 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:48

    For ARC you can use.

    return (__bridge_transfer NSArray*)peopleArray;
    

    "__bridge_transfer" will transfer the ownership to ARC and therefore you don't need any further release call.

提交回复
热议问题