通讯录增删改查
CoreFoundaion.framework
AddressBook.framework
#import "AddressBook/AddressBook.h"
ABAddressBookRef addressBook = ABAddressBookCreate(); //初始化一个record ABRecordRef person = ABPersonCreate(); //这是一个空的记录,或者说是没有任何信息的联系人 //下面给这个人 添加一个名字 NSString *firstName = @"Tr"; ABRecordSetValue(person, kABPersonFirstNameProperty, (CFStringRef)firstName, NULL); NSString *lastName = @"Lee"; ABRecordSetValue(person, kABPersonLastNameProperty, (CFStringRef)lastName, NULL); //给他再加一个生日 NSDate *bdate = [NSDate date]; ABRecordSetValue(person, kABPersonBirthdayProperty, (CFDateRef)bdate, NULL); //备忘 NSString *temNote = @"note test"; ABRecordSetValue(person, kABPersonNoteProperty, (CFStringRef)temNote, NULL); //将新的记录,添加到通讯录中 ABAddressBookAddRecord(addressBook, person, NULL); //通讯录执行保存 ABAddressBookSave(addressBook, NULL); //不说了,你懂的~ if(addressBook) CFRelease(addressBook);