ABAddressBook store values in NSDictionary

前端 未结 3 1602
执念已碎
执念已碎 2021-01-07 04:30

I have an app that displays ABAddressBook contacts in a UITableView. Currently I\'m reading the contacts into an NSDictionary, however

3条回答
  •  悲哀的现实
    2021-01-07 04:59

    Same as Abizern's answer, but if you want to display full names that are localized, use ABRecordCopyCompositeName. (In English names are "First Last", but in Chinese names are "LastFirst").

    ABRecordRef person = CFArrayGetValueAtIndex(addressBookData, idx);
    NSString *fullName = (__bridge_transfer NSString *)ABRecordCopyCompositeName(person);//important for localization
    

提交回复
热议问题