Obtaining Specific ABSource from ABAddressBook in iOS 4+

后端 未结 4 597
长情又很酷
长情又很酷 2020-11-28 12:43

Does anyone have an example of how to obtain a specific ABSource from the ABAddressBook in iOS 4+?

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 13:07

    The code has errors, thats why it always returns two, since the method: ABRecordGetRecordType is not a part of the ABSource. It only includes:

    kABPersonType for person records kABGroupType for group records. kABSourceType for source records.

    To figure out the right type you have to use: ABRecordCopyValue(source, kABSourceTypeProperty) instead! :) Works excellent on my iPhone with or without localSource.

    Good luck!

提交回复
热议问题