0

I found some bugs related to ABGroupAddMember on following sites:

http://www.iphonedevsdk.com/forum/iphone-sdk-development/65614-issues-abaddressbokk-since-update-ios-4-2-a.html

http://www.3manzana.com/2010/12/bug-no-ios-42-abgroupaddmember.html

Has anyone else seen this behaviour? are there any solutions?

1 Answer 1

2

I've experienced the same. Here's the fix.

The solution is to add the person (even if the person already exists), then to save the address book. Next add the person to the group, then save the address book again.

CFErrorRef err = nil;

//-- add the person to the address book (even if the person already exists)
ABAddressBookAddRecord(abAddressBookRef, person, nil);

//-- save the address book
ABAddressBookSave(abAddressBookRef, &err);

//-- add the person to the group
ABGroupAddMember(abGroupRef, person, &err);

//-- save the address book again
ABAddressBookSave(abAddressBookRef, &err);

Should solve most issues of this nature, as I experienced some of these issues way before OS 4.2, and this does the trick.

1
  • Still seem to be having this bug in iOS 6.0.1, any news on a proper workaround or fix?
    – Dan F
    Jan 8, 2013 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.