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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:30:34+00:00 2026-05-27T08:30:34+00:00

I copied this method, line by line from the apple dev library and getting

  • 0

I copied this method, line by line from the apple dev library and getting casting errors for the two NSString casts. How can those be resolved? (I am using ARC)

- (BOOL)peoplePickerNavigationController:
        (ABPeoplePickerNavigationController *)peoplePicker
  shouldContinueAfterSelectingPerson:(ABRecordRef)person {

NSString* name = (NSString *)ABRecordCopyValue(person,
                                         kABPersonFirstNameProperty);
self.firstName.text = name;

name = (NSString *)ABRecordCopyValue(person, kABPersonLastNameProperty);
self.lastName.text = name;

[self dismissModalViewControllerAnimated:YES];

return NO;
}

Thank you for your help!

  • 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-27T08:30:35+00:00Added an answer on May 27, 2026 at 8:30 am

    It sounds like you are using ARC.

    ARC forbids standard casts between pointers to Objective-C objects and pointers of other types, including pointers to CoreFoundation objects.

    The following code, which is correct under manual memory management, does not compile with ARC:

    NSString* name = (NSString *)ABRecordCopyValue(person,
                                 kABPersonFirstNameProperty);
    

    To make it compile with ARC, you need to annotate the cast. See bridged casts.

    NSString* name = (__bridge_transfer NSString *)ABRecordCopyValue(person,
                                                   kABPersonFirstNameProperty);
    

    The __bridge_transfer annotation moves the value into ARC and transfers ownership, i.e., it tells ARC that this object is already retained, and that ARC doesn’t need to retain it again.

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

Sidebar

Related Questions

I copied this code from an example . I've read it 100 times. Array.prototype.map
this is copied from http://www.zenspider.com/ZSS/Products/RubyInline/Readme.html , the home of rubyinline, adding/moding as indicated in
I have this sample code for async operations (copied from the interwebs) public class
I can't compile this code because of several errors. Most of the errors are
This simple line of code gives the error The method getTextContent() is undefined for
This script is getting Microsoft JScript runtime error: Object expected on If (out_params.bGranted) line.
I am getting this error: Uncaught TypeError: Object [object Object] has no method 'calendricalDate'
I copied and pasted this binary data out of sql server, which I am
When someone installs this plugin, I would like a file to be copied into
Still fighting with templates. In this example, despite the fact that is copied straight

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.