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

  • Home
  • SEARCH
  • 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 9003421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:42:36+00:00 2026-06-16T00:42:36+00:00

I have two tableViewControllers. The first one has a list of contacts. The another

  • 0

I have two tableViewControllers. The first one has a list of contacts. The another one shows detailed person’s information.

A chunk of code of first tableViewController

ABAddressBookRef addressBook = ABAddressBookCreate();
ABRecordRef source = ABAddressBookCopyDefaultSource(addressBook);
NSArray *allPeople = (__bridge_transfer NSArray*)ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering(addressBook, source,kABPersonSortByFirstName);
for ( int i = 0; i < [allPeople count]; i++ )
{
    ...
    contactClass = [[ContactClass alloc] initWithName:name surName:surName manID:[allPeople objectAtIndex:i]];
    ...
}

A chunck of code of second tableViewController

ABRecordRef person = (__bridge  ABRecordRef)contactClass.manID;
BOOL isHasImage = ABPersonHasImageData(person);

Variable isHasImage is always false, even if contact has an avatar. I even checked this on the first tableViewController and if person has an avatar, then it returns true and image.

Does anyone knows why I can’t get contacts image?

p.s. contactClass.manID is type of id. It has a correct adress, because ABMultiValueRef multiValue = ABRecordCopyValue((__bridge ABRecordRef)contactClass.manID, kABPersonPhoneProperty); returns correct value in the second tableViewController

  • 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-16T00:42:36+00:00Added an answer on June 16, 2026 at 12:42 am

    I may be too late for a solution for you, but maybe this will help others that are stuck with the same problem.
    Looks like ABPersonHasImageData() and ABPersonCopyImageDataWithFormat() don’t work as expected on ABRecordRef copies (e.g. an ABContactRef from an array obtained using ABAddressBookCopyArrayOfAllPeople()), at leas on iOS 5.x. You may workaround it like this:

    - (UIImage*)imageForContact: (ABRecordRef)contactRef {
        UIImage *img = nil;
    
        // can't get image from a ABRecordRef copy
        ABRecordID contactID = ABRecordGetRecordID(contactRef);
        ABAddressBookRef addressBook = ABAddressBookCreate();
    
        ABRecordRef origContactRef = ABAddressBookGetPersonWithRecordID(addressBook, contactID);
    
        if (ABPersonHasImageData(origContactRef)) {
            NSData *imgData = (NSData*)ABPersonCopyImageDataWithFormat(origContactRef, kABPersonImageFormatOriginalSize);
            img = [UIImage imageWithData: imgData]; 
    
            [imgData release];
        }
    
        CFRelease(addressBook);
    
        return img;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two UITableViewControllers. One displays a list of names and on tapping any
Have two issues one is showFromToolbar statement format warning issue and another is that
have two classes, A and B, where B extends A and has one attribute
I have two UITableViewControllers with a fairly simple ui flow. One UITableViewController loads another
I have two batch files, one of them executes another, i.e. My Batch File
Have two actionsheet buttons and one modalviewcontroller on mainviewcontroller in application. Now for two
I have two classes (MVC view model) which inherits from one abstract base class.
I have a TableViewController that is using a grouped Style and has two(2) sections.
Have two tables say ABC and XYZ and contain one column which data will
I have two tables one with an add button and one without an add

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.