Im using the code below to try and make a new contact in the addressBook, for some reason when i get to the ABAddressBookAddRecord, the didset returns false and i can not figure out why. Are there functions i forgot to call because i feel like this should work?
ABRecordRef record = ABPersonCreate();
CFErrorRef err = NULL;
ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(nil, &err);
bool didset;
didset = ABRecordSetValue(record, kABPersonFirstNameProperty, CFSTR("test"), &err);
didset = ABRecordSetValue(record, kABPersonLastNameProperty, CFSTR("monkey"), &err);
didset = ABRecordSetValue(record, kABPersonPhoneProperty, CFSTR("123-123-1234"), &err);
didset = ABAddressBookAddRecord(addressBook, record, &err);
if (ABAddressBookHasUnsavedChanges(addressBook))
{
didset = ABAddressBookSave(addressBook, &err);
}