Moo*_*Soo 10 iphone xcode objective-c ios
我正在学习iOS编程.
我编写了与地址相关联的代码.
有很多方法.喜欢
我正在分组.
这是group1
ABAddressBookCreate();
ABRecordCopyCompositeName(argument);
ABRecordCopyValue(argument1, argument2);
ABRecordCopyValue(argument1, argument2);
ABMultiValueCopyLabelAtIndex(argument1, argument2);
ABMultiValueCopyValueAtIndex(argument1, argument2);
Run Code Online (Sandbox Code Playgroud)
另一个就在这里,group2
CFArrayGetCount(argument);
CFArrayGetValueAtIndex(argument1, argument2);
ABMultiValueGetCount(argument);
Run Code Online (Sandbox Code Playgroud)
我知道还有很多其他的方法.
但我想知道我什么时候使用CFRelease方法.
我认为group2的所有方法都不做CFRelease
因为它包含单词"Get",未分配.
我认为group1的所有方法都必须使用CFRelease
因为有一个字符串"copy".
我有一本书.
但是有两次使用CFRelease.
一个是发布ABAddressBookCreate()
另一个是ABAddressBookCopyPeopleWithName.
所有其他事情都不使用CFRelease.
所以我想知道我何时使用CFRelease.
当我使用CFRelease时请告诉我.