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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:42:31+00:00 2026-05-26T20:42:31+00:00

i was using xcode 3.2 yesterday on 10.6, I upgraded to 10.7 with xcode

  • 0

i was using xcode 3.2 yesterday on 10.6, I upgraded to 10.7 with xcode 4.2 the address book project which worked well in xcode 3.2, doesn’t work in the new version of xcode, the following error is: (/Users/Blake/Development/g/g/ViewController.m:37:37:{37:37-37:56}{37:48-37:56}: error: cast of C pointer type ‘CFStringRef’ (aka ‘const struct __CFString *’) to Objective-C pointer type ‘NSString *’ requires a bridged cast [4]

    phones = [[NSMutableArray alloc] init];
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef peopleRecords = ABAddressBookCopyArrayOfAllPeople(addressBook);

for (int i = 0; i < CFArrayGetCount(peopleRecords); ++i)
{
    ABRecordRef recordRef = CFArrayGetValueAtIndex(peopleRecords, i);
    ABMultiValueRef phoneRefs = ABRecordCopyValue(recordRef, kABPersonPhoneProperty);

    for (int a = 0; a < ABMultiValueGetCount(phoneRefs); ++a)
    {
        CFStringRef phoneStr = ABMultiValueCopyValueAtIndex(phoneRefs, a);
        NSString* phoneString = (NSString*)phoneStr;
        [phones addObjectphoneString];
        CFRelease(phoneStr);
    }

    CFRelease(phoneRefs);
}

CFRelease(addressBook);
CFRelease(peopleRecords);

for (NSString *phone in phones)
{
    NSLog(@"%@", phone) ;
}
  • 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-26T20:42:32+00:00Added an answer on May 26, 2026 at 8:42 pm

    I do it like this:

    //get all phone numbers                   
    ABMultiValueRef phoneNumberProperty = ABRecordCopyValue(currentPerson, kABPersonPhoneProperty);
    NSArray *phoneNumbersArray = (NSArray*)ABMultiValueCopyArrayOfAllValues(phoneNumberProperty);
    

    Then I iterate the phoneNumbersArray for NSString.

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

Sidebar

Related Questions

Using Xcode 4.2.1 iPad iOS 5.0.1, create a new Single View iPad project. In
I'm new to development using Xcode, and am having trouble using the built-in Leaks
I've developed an app using xcode 4.2 and storyboard and yesterday when I tried
Using Xcode 4.2, I created a new app using the tab bar template. For
I am using Xcode 3.2.1 in project, where Base SDK is iPhone Device 3.0
For my first time using Xcode I was following a tutorial online. I did
Using Xcode 4.x I created a SplitView project for iPad From RootViewController I'm trying
Using XCode 3.2.3 (64-bit), I get following strange output. What am I doing wrong?
I have done an application named irewards using Xcode 4.1 and it worked fine
Everything was working perfectly fine in Xcode 3 yesterday before I upgraded. So I

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.