开发者

How to create string property for each address book record?

I want to store network carrier as a string (e.g. AT&T) for each contact in address book.

I found a method addPropertiesAndTypes for creating a custom property. But I am not able to find any proper example to do this.

I am using following code to iterate through contact book records:

ABAddressBookRef addressBook = ABAddressBookCreate();
CFAr开发者_运维百科rayRef addressArr = ABAddressBookCopyArrayOfAllPeople(addressBook);
CFIndex nPeople = ABAddressBookGetPersonCount(addressBook);
for(int i=0; i<nPeople; i++) {

    ABRecordRef recref = CFArrayGetValueAtIndex(addressArr, i);
}

And my query is, the property will stay with value after app is closed. Are these property is getting saved in address book database?

Help needed. Thanks.


Make sure you call ABAddressBookSave().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜