views:

56

answers:

1

Hi, 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();
CFArrayRef 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.

+1  A: 

Make sure you call ABAddressBookSave().

Costique
yes, but how to create and set value for custom property?
Ruchir Shah