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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:41:40+00:00 2026-05-17T21:41:40+00:00

Using the ‘AddressBook.framework’ is it possible to filter out all companies (i.e. just people).

  • 0

Using the ‘AddressBook.framework’ is it possible to filter out all companies (i.e. just people). For example, how would one modify the following code to remove companies:

ABAddressBookRef addressbook = ABAddressBookCreate();
CFArrayRef contacts = ABAddressBookCopyArrayOfAllPeople(addressbook);

I found that companies do not appear to be stored as groups (they are still returned with the above call). Thanks!

  • 1 1 Answer
  • 1 View
  • 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-17T21:41:40+00:00Added an answer on May 17, 2026 at 9:41 pm

    You are correct, companies are records/people in the Address Book.

    Look up the value for the kABPersonFlags — one of the flags is “show as company”. Then just do a bitmask and compare.

    if (([aPerson valueForProperty:kABPersonFlags] & kABShowAsMask) == kABShowAsCompany) {
       // it's a company
    } else {
       // it's a person, resource, or room
    }
    

    I used the following references from Apple, which you should probably read as well:

    • Address Book Programming Guide for Mac OS X
    • Address Book Constants Reference
    • ABPerson Class Reference

    EDIT: Sorry, the above is for Address Book on Mac OS X. Try this for iOS:

    ABRecordRef aRecord = ...  // Assume this exists
    CFNumberRef recordType = ABRecordCopyValue(aRecord, kABPersonKindProperty);
    if (recordType == kABPersonKindOrganization) {
       // it's a company
    } else {
       // it's a person, resource, or room
    }
    

    The idea is the same: get the value of the person type property, and see what it tells you.

    Used these Apple docs:

    • Address Book Programming Guide for iOS
    • ABPerson Reference
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using C# (the .NET framework), I'm looping through all the TimeZones and their AdjustmentRules...
Using jQuery, one can easily find out whether a particular element is visible using
Using a restful resource in Rails, I would like to be able to insert
Using Flex 3, I would like to take an image snapshot such as this:
Using Rails 3.2.0 with haml and sass: I Would like to link an external
Using mercurial, I've run into an odd problem where a line from one committer
using a binary search tree I need to add to a vector all int
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using Entity Framework CodeFirst, how do I create a created datetime column that gets
Using Github's Issue Tracker, how can one create an issue tied to an organization

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.