Keeping a long-term reference to an IOS AddressBook entry

后端 未结 4 1054
傲寒
傲寒 2020-12-05 11:31

Given that an ABRecordID can change between cloud syncs and under other circumstances out of my control, how can I maintain a long-term reference to an IOS address book reco

4条回答
  •  醉酒成梦
    2020-12-05 12:16

    The documentation is communicating to you that you can't count on ABRecordID as a permanent identifier.

    Consider this scenario: The user has a record for "Bob Smith". The user then deletes his "Bob Smith" record and then imports his contacts from his computer (creating a new ID) through iTunes sync.

    So if you want to keep a permanent reference to an existing contact, you can keep a reference to the name and id as a hint that it is the same record you used before- but there is no real permanent reference.

    If you keep a permanent reference to an address book contact, you must always be ready to deal with the fact that it may not be the same contact you used before.

提交回复
热议问题