Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7877161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:17:32+00:00 2026-06-03T03:17:32+00:00

I create one new application.i add the contact from address book see the code

  • 0

I create one new application.i add the contact from address book see the code below but how to edit this add contact from address book i don’t know .

can any one have know then give the sample code or idea.

thanx in advance give your valuable time for me.

//code for add contact in contact list 

ABRecordRef aRecord = ABPersonCreate(); 
CFErrorRef  anError = NULL; 
ABRecordSetValue(aRecord, kABPersonFirstNameProperty, 
                 txtfirstname.text, &anError); 
ABRecordSetValue(aRecord, kABPersonLastNameProperty, 
                 txtlastName.text, &anError); 
ABRecordSetValue(aRecord, kABPersonBirthdayProperty, 
                 [datepick date], &anError); 
ABRecordSetValue(aRecord, kABPersonPhoneProperty, 
                 txtMobileNo, &anError); 
ABRecordSetValue(aRecord, kABPersonEmailProperty, 
                 txtEmailID, &anError); 
if (anError != NULL) 
{ 
    NSLog(@"error while creating..");
} 
CFStringRef firstName, lastName,birthDay; 
firstName = ABRecordCopyValue(aRecord, kABPersonFirstNameProperty); 
lastName  = ABRecordCopyValue(aRecord, kABPersonLastNameProperty); 
birthDay  = ABRecordCopyValue(aRecord, kABPersonBirthdayProperty); 

ABMutableMultiValueRef email = ABMultiValueCreateMutable(kABMultiStringPropertyType);
ABMultiValueAddValueAndLabel(email, txtEmailID.text, CFSTR("email"), NULL);
ABRecordSetValue(aRecord, kABPersonEmailProperty, email, &anError);
CFRelease(email);

ABMutableMultiValueRef multiPhone =  ABMultiValueCreateMutable(kABMultiStringPropertyType);
ABMultiValueAddValueAndLabel(multiPhone,txtMobileNo.text, kABPersonPhoneMainLabel, NULL);
ABRecordSetValue(aRecord, kABPersonPhoneProperty, multiPhone,nil);
CFRelease(multiPhone);

UIImage *personImage;   
personImage = tempimage;
NSData *dataRef = UIImagePNGRepresentation(personImage); 
CFDataRef dr = CFDataCreate(NULL, [dataRef bytes], [dataRef length]);
CFErrorRef error = NULL; 

ABPersonSetImageData(aRecord, dr, &error);  


ABAddressBookRef addressBook; 
addressBook = ABAddressBookCreate(); 

BOOL isAdded = ABAddressBookAddRecord (addressBook,aRecord,&error);

if(isAdded)
{
    NSLog(@"added..");
}
if (error != NULL) {
    NSLog(@"ABAddressBookAddRecord %@", error);
} 
error = NULL;

BOOL isSaved = ABAddressBookSave (addressBook,&error);

if(isSaved)
{
    UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Contact Save"
                                                        message:nil delegate:self 
                                              cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
    [alertView show];
    [alertView release];
    NSLog(@"saved..");
}

if (error != NULL) 
{
    NSLog(@"ABAddressBookSave %@", error);
} 

CFRelease(aRecord); 
CFRelease(firstName); 
CFRelease(lastName);
    CFRelease(birthDay); 
CFRelease(addressBook);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:17:32+00:00Added an answer on June 3, 2026 at 3:17 am

    Apple’s sample project QuickContacts covers this: http://developer.apple.com/library/ios/#samplecode/QuickContacts/Introduction/Intro.html.

    i hope it’s helpful to you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to manipulate an existing XML document, and create a new one from
I tryed to create new components from one base Windows Form, also I found
I have a strange one. Create a new form. Then add the following function
My iPhone development profile is expiring soon. Should I create a new one, or
Does startService() create a new Service instance or using the existing one? For example,
In jQuery you can create new elements and define properties on them in one
One of my web pages allows the user to create a new record, and,
I want to create a new object using Class::DBI. One of the fields of
Normally, when I start up a new application, I'd create a new git repository
I have made an application which calls the phone's contact list but i want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.