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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:35:44+00:00 2026-05-28T15:35:44+00:00

I have an mutableArray and put the number of a contact in it. I

  • 0

I have an mutableArray and put the number of a contact in it.

I use the following code:

ABMultiValueRef phoneNumbers = (ABMultiValueRef)ABRecordCopyValue(person, kABPersonPhoneProperty);
CFRelease(phoneNumbers);
number = (__bridge NSString*)ABMultiValueCopyValueAtIndex(phoneNumbers, 0);


[thenumbers addObject:number];

In order to retrieve it, I do this:

Contacts *num = [thenumbers objectAtIndex:indexPath.row];
NSString *numbers = [NSString stringWithFormat:@"%@", [num number]];
cell.detailTextLabel.text = numbers;

I set breakpoints and it stops at the right lines. I also tried

NSLog(@"%@", number);

And it returns the numbers. And yes I have reloadDate in viewWillappear.

  • 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-28T15:35:45+00:00Added an answer on May 28, 2026 at 3:35 pm

    You’re releasing phoneNumbers straight after copying to it. Try moving it to after you use it.

    Or, better still, transfer the ownership to the NSString object through ARC

    ABMultiValueRef phoneNumbers = (ABMultiValueRef)ABRecordCopyValue(person, kABPersonPhoneProperty);
    number = (__bridge_transfer NSString*)ABMultiValueCopyValueAtIndex(phoneNumbers, 0);
    

    And there is no need to call CFRelease(phoneNumbers) at all.

    As for getting the numbers into the cell, you’re getting confused about your types. You’re putting an NSString into theNumber but your pulling out a Contacts. And then sending it some kind of number message.

    You’ve put a string in the array, you can only pull out a string or a subclass.

    NSString *numbers = [thenumbers objectAtIndex:indexPath.row];
    cell.detailTextLabel.text = numbers;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 3 MutableArray 's, but only want to use one of them, to
I have the following piece of code. I am a bit unsure about retain/release
I have an array,something like below MutableArray ( { a = 1; b =
i have a group of GLfloat C [] arrays that i wamt to put
In my application I have One MutableArray comes like this, Idlist:( 1, 2, 3
I have an tableview which is loaded from a mutablearray as listed below. However
I have this while loop in my code. The loop seems to work fine
I have five integers.I added all integers to a mutableArray and shuffled it. int
When I use NSMutableArray or NSMutableDictionary , if I know the number of elements
I have this code now: This is iOS for(NSDictionary * dict in myMutableArray) {

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.