ABPerson has api to get all "linked" person records.

CFArrayRef ABPersonCopyArrayOfAllLinkedPeople (
   ABRecordRef person
);

What determines the return result of this call (i.e. how are links established)? My goal is to create a new address book record (in code) that is linked to an existing record.

有帮助吗?

解决方案

I've accomplished this by trying to write the information to the ABRecordRef in question, as well as the records linked to it. If writing to all linked records fails for permission (in the case that the only record is a Facebook contact, for example) I created a new record with the same first and last name as the existing record(s) and address book linked them. That behavior isn't documented anywhere, but with out a public method to link contacts, it might be the only option.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top