ABRecordSetValue(person, kABPersonPhoneProperty, (__bridge CFTypeRef)phoneNum, nil);
ABRecordSetValue(person, kABPersonEmailProperty, (__bridge CFTypeRef)eMailId, nil);
Commenting these two lines gives proper output (Saving the entry to AdressBook, without email and phone entry).
But, while in execution it fails and crashes the program.
Value for the Vars are:
phoneNum : 000-000-0000
eMailId : AbcdefghIjklm@qwertyuiopasdfghjk.com
Error type: EXC_BAD_ACCESS
Any Idea?
Or need any more info??
It would be good to see where and of what type you define the vars. You may have also released the address book before those lines. (e.g.
CFRelease(multiPhone);)And as far as I know,
phoneNumandemailIDshould beABMutableMultiValueRef. At least that was how I did it:Adding a single phone number
Adding e-mail:
More info on Address Book tutorial
Hope this helps.