II尝试更改ABPerson / ABMultiValue的值(电话号码)。

无论如何要更新这些?

ABAddressBook *ab = [ABAddressBook sharedAddressBook];
NSArray *persons = [ab people];

int j=[persons count];

for (int i=0; i<j; i++) {
    ABPerson *person = [persons objectAtIndex:i];
    ABMultiValue *phonenumbers = [person valueForProperty:kABPhoneProperty];
    //  update here *phonenumbers
}


谢谢!

最佳答案

尝试致电:

ABMultiValueRef phoneNumbers = ABMultiValueCreateMutable(kABPersonPhoneProperty);
ABMultiValueAddValueAndLabel(phoneNumbers, value, label, null);
ABRecordSetValue(person, kABPersonPhoneProperty, phoneNumbers, NULL);


为您要添加的每个值添加以下之一:ABMultiValueAddValueAndLabel(phoneNumbers, value, label, null)

关于cocoa - 如何更新:(COCOA/OSX)ABPerson/ABMultiValue(电话号码)?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4663122/

10-10 17:52