以编程方式更改ABAddressBook,ABPersonCopyArrayOfAllLinkedPeople中的链接联系人数组 [英] Programmatically change linked contacts array in ABAddressBook, ABPersonCopyArrayOfAllLinkedPeople
问题描述
可以通过编程方式添加/删除由 ABPersonCopyArrayOfAllLinkedPeople 返回的CFArray内部的联系人,从而有效地链接和取消链接来自各种来源的联系人的不同记录,以在iO中显示为统一
Can one programmatically add/remove the contacts inside the CFArray returned by ABPersonCopyArrayOfAllLinkedPeople, thus, effectively, linking and un-linking different records of contacts from various sources to show as "unified" in the iOs phone book?
推荐答案
据我所知,没有公开的API用于链接或取消链接联系人,至少在iOS 6 SDK中。但是,似乎确实可以通过调用未记录的私有函数 bool ABPersonLinkPerson(ABRecordRef from,ABRecordRef to)
在联系人之间创建链接。该签名可能并不完全正确-我尚未对它进行彻底的测试。
As far as I've been able to determine, there is no public API exposed for linking or unlinking contacts, at least in the iOS 6 SDK. However, it does appear that you can create links between contacts by calling the undocumented, private function bool ABPersonLinkPerson(ABRecordRef from, ABRecordRef to)
. That signature may not be exactly right--I haven't tested this too thoroughly.
如果您使用私有API,那么您的应用当然不太可能获得批准,但是如果您想为进行单元测试而制作一个伪造的通讯录,并且想要在其中建立一些联系的联系人,这可能会很有用。
Your app is of course unlikely to be approved if you make use of private APIs, but if you're trying to, say, make a fake address book for the sake of unit testing and you want some linked contacts in that, this could be useful.
这篇关于以编程方式更改ABAddressBook,ABPersonCopyArrayOfAllLinkedPeople中的链接联系人数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!