本文介绍了以编程方式更改ABAddressBook中的链接联系人数组,ABPersonCopyArrayOfAllLinkedPeople的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以通过编程方式添加/删除 ABPersonCopyArrayOfAllLinkedPeople 返回的CFArray中的联系人,从而有效地链接和取消链接来自各种来源的不同联系人记录,以在iOs中显示为统一电话簿?

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 18:02