Add contact to AddressBook

by alex 11. May 2009 14:25

//Also you need to include AddressBook.framework

#import <AddressBook/AddressBook.h>

#import <AddressBook/ABAddressBook.h>

#import <AddressBook/ABPerson.h>

 

 

 

ABAddressBookRef addressBook = ABAddressBookCreate();

ABRecordRef person = ABPersonCreate();

 

ABRecordSetValue(person, kABPersonFirstNameProperty, @"Alex" , nil);

ABRecordSetValue(person, kABPersonLastNameProperty, @"Test", nil);

ABAddressBookAddRecord(addressBook, person, nil);

ABAddressBookSave(addressBook, nil);

 

CFRelease(person);


Currently rated 3.0 by 2 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

General

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen