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 6871985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:52:14+00:00 2026-05-27T03:52:14+00:00

I have a Addressbook in my App which gets filled from a website by

  • 0

I have a Addressbook in my App which gets filled from a website by json. If I add a new Person on my website the person get added to the app addressbook on the next launch. If I update a persons name on my website it works perfectly.. but if I add a new image to a existing person it still shows the old default image from Apple after the reload. If I compile it the picture appears. Is there a cache for addressbook pictures?

I tried the following:

BOOL imgBool = ABPersonHasImageData(aContact); -> false

and

ABPersonRemoveImageData(aContact, &anError); -> false because no picture in AB

I add a Persons picture like this:

UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[[[self.profsInSection objectAtIndex:indexPath.section] objectAtIndex:indexPath.row] bildUrl]]]];
NSData *picData = UIImageJPEGRepresentation(image, 0.9f);
[...]
ABPersonSetImageData(aContact, (CFDataRef)picData, nil);

There are no Errors, it just saves the last picture and ignores new pictures… 🙁 Any ideas?

  • 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-05-27T03:52:14+00:00Added an answer on May 27, 2026 at 3:52 am

    Haven’t you forget to call saving function, after applying your changes in the address book?

    ABAddressBookSave(addrBook, nil);
    

    UPDATE: so, as long as you’re using ABUnknownPersonViewController, I’ve tried the following code by myself and it’s working both on the simulator & device

      ABRecordRef newPerson = ABPersonCreate();
    
      ABRecordSetValue(newPerson, kABPersonLastNameProperty, @"Smith", nil);
    
      UIImage *personImage = [UIImage imageNamed:@"image.jpg"];
      NSData *dataRef = UIImageJPEGRepresentation(personImage, 0.9f);
    
      CFErrorRef error = nil;
      bool result = ABPersonSetImageData(newPerson, (CFDataRef)dataRef, &error);
    
      ABUnknownPersonViewController *controller = [ABUnknownPersonViewController new];
        //controller.addressBook = addressBook;
      controller.allowsAddingToAddressBook = YES;
      controller.displayedPerson = newPerson;
    
      [self.navigationController pushViewController:controller animated:YES];
      [controller release];
    

    The issue I’ve met when was testing this code, was my mistype in image name, so the UIImage instance was nil and NSData was empty. And ABPersonSetImageData gave no error on this. So, double check your UIImage instance is not nil.

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

Sidebar

Related Questions

In my application I have to get the record form the AddressBook and after
I have an iPhone app that makes use of the AddressBook.framework and uses Core
I have a question regarding uitable view. I am implementing an app which is
I am creating an iPhone app which I would like to have a similar
I am developing an app in which I have to allow user to edit
I have done the following to get record for user info from address book.
I have a custom addressbook built into a c#.net app. My users have gone
I have to made an app with an AddressBook, different by the internal iphone
I'm adding contact details to the address book from my app. And I have
I get contacts from the address book in my app, but when I take

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.