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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:45:18+00:00 2026-05-14T02:45:18+00:00

I found a tutorial online that extends that Apple QuickStart Application which is the

  • 0

I found a tutorial online that extends that Apple QuickStart Application which is the basic Address Book Application and another that returns the first phone number regardless of what phone number was clicked. I want to display only the selected phone number in the label. The label is called phoneNumber:

- (BOOL)peoplePickerNavigationController:

(ABPeoplePickerNavigationController *)peoplePicker

  shouldContinueAfterSelectingPerson:(ABRecordRef)person

                            property:(ABPropertyID)property

                          identifier:(ABMultiValueIdentifier)identifier{


ABMutableMultiValueRef phoneMulti = ABRecordCopyValue(person, kABPersonPhoneProperty);
NSMutableArray *phones = [[NSMutableArray alloc] init];
int i;
for (i = 0; i < ABMultiValueGetCount(phoneMulti); i++) {
NSString *aPhone = [(NSString*)ABMultiValueCopyValueAtIndex(phoneMulti, i)autorelease];

    [phones addObject:aPhone];
}

NSString *mobileNo = [phones objectAtIndex:0];
self.phoneNumber.text = phones;

[self dismissModalViewControllerAnimated:YES];

return NO;

}

How do I ensure that the label is the one selected by the user and not just the first array entry(or any other array entry i code in)

Thanks

  • 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-14T02:45:18+00:00Added an answer on May 14, 2026 at 2:45 am

    I’m not sure I understand your question, but if you’re trying to get the phone number and/or label your user actually selected, you can use this:

        - (BOOL)peoplePickerNavigationController: (ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
            // ensure user picked a phone property
            if (property == kABPersonPhoneProperty) {
                ABMultiValueRef phone = ABRecordCopyValue(person, property);
                CFStringRef selectedNumber = ABMultiValueCopyLabelAtIndex(phone, identifier);
                CFStringRef selectedLabel = ABMultiValueCopyValueAtIndex(phone, identifier);
                // insert code to do something with the values above
                [self dismissModalViewControllerAnimated:YES];
                return NO; } // end if
            else {
                // display an alert or something - handle the error
    } } // end else, end method
    

    I’m not following your code snippet – not sure what you’re using the array for if all you want is the user’s selected choice.

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

Sidebar

Related Questions

I remember once I found a nice online tutorial that showed how WPF works
I'm running through this tutorial found here: http://vb.net-informations.com/crystal-report/vb.net_crystal_report_from_multiple_tables.htm which teaches how to pass a
I have just found this great tutorial as it is something that I need.
I found this script online that creates a thumbnail out of a image but
I'm new to Objective C and I'm going through a tutorial I found online
I read some tutorials online, and found that LocationManager does this. This is the
Right now I am developing an application that will allow online registration. For development,
I found some tutorials online that could help but I am not sure there
I have found a Tutorial here on how to implement drag and drop in
I followed the tutorial found here and added my own flare to it: tutorial

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.