Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You would like to work with a user’s contacts. To do this, first you need to get a reference to the user’s address book database. This reference is what you use to retrieve entries, as well as to make and save changes.
Use the ABAddressBookCreate
function in the Address Book framework:
- (BOOL) application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
ABAddressBookRef addressBook = ABAddressBookCreate();
if (addressBook != nil){
NSLog(@"Successfully accessed the address book.");
/* Work with the address book here */
/* Let's see if we have made any changes to the
address book or not, before attempting to save it */
if (ABAddressBookHasUnsavedChanges(addressBook)){
/* Now decide if you want to save the changes to
the address book */
NSLog(@"Changes were found in the address book.");
BOOL doYouWantToSaveChanges = YES;
/* We can make a decision to save or revert the
address book back to how it was b....