Accessing the email value from the iPhone AddressBook

Need some help getting the email value from the AddressBook. This is what I have so far ...
Used to open up the picker and limit to email only
-(void) browseButtonPressed:(id)sender
ABPeoplePickerNavigationController* controller = [[ABPeoplePickerNavigationController alloc] init];
controller.peoplePickerDelegate = self;
NSNumber* emailProp = [NSNumber numberWithInt:kABPersonEmailProperty];
controller.displayedProperties = [NSArray arrayWithObject:emailProp];
controller.navigationBar.tintColor = [UIColor blackColor];
[self presentModalViewController:controller animated:YES];
The delegate method in the same class
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier
NSString *email = (NSString *)ABRecordCopyValue(person, kABPersonEmailProperty);
NSLog(@"selected person: %@", email);
[[peoplePicker parentViewController] dismissModalViewControllerAnimated:YES];
return NO;
The NSLog prints the following ...
selected person: <NSCFType: 0x1d81c0>
Any idea why it's not printing a string rather I am getting NSCFType ?

Great Post. One of the few times that I was able to come to a conclusion about the code I need. Here is an example of the delegate method in reference to getting the email address.
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
ABMultiValueRef emails = ABRecordCopyValue(person, property);
CFStringRef email = ABMultiValueCopyValueAtIndex(emails, identifier);
NSLog( (NSString *) email);
self.receiverEmail.text = (NSString *) email;
[self.tabBarController dismissModalViewControllerAnimated:YES];
return NO;
}

Similar Messages

  • Cannot access my emails anymore from my iphone 4s.

    Cannot access my emails anymore from my iphone 4s.  Shut down phone and even rebooted to no avail.  Went into settings and deleted the account but it came right back.  Help.

    Contact the email provider.

  • I bought a used iphone 4 today. how to transfer all my old and important data including apps and email settings from old iphone 3gs to the used iphone 4?

    i bought a used iphone 4 today. how to transfer all my old and important data including apps and email settings from old iphone 3gs to the used iphone 4? that means, making the iphone 4 just like the iphone 3gs?

    Well, you sink everything on your 3GS onto your laptop/computer. Then you reset your iPhone 4. When you are restarting it, add all those apps music (ect)  On to it. It seems difucult but for more info call Apple. I did that and he lead me step by step on how to do it. Well hope this helped~~

  • HT201774 How do I delete excess email messages from my iPhone.  There are 300 messages listed, and every time I delete some, more are added from old messages.  How do I limit the number of messages that can appear on my phone?  How can I delete messages i

    How do I delete excess email messages from my iPhone.  There are 300 messages listed, and every time I delete some, more are added from old messages.  How do I limit the number of messages that can appear on my phone?  How can I delete messages in bulk,

    You can't.
    All photos transferred from your computer are stored in the Photo Library. The photos in the album or albums below are not duplicates - they include a pointer to the original photos stored in the Photo Library. This way you can view the photos in a particular album only by selecting the album, or you can view all photos available in all albums by selecting Photo Library.
    Just as with an iTunes playlist. A song cannot be in an iTunes playlist unless the song is in the main iTunes library. Placing a song in a playlist does not duplicate the song. Remove the main iTunes library or the songs from the main iTunes library that are in a playlist and the songs will no longer be in the playlist either. This way you can listen to the songs in the playlist only by selecting the playlist, or all songs in your entire iTunes library by selecting Music under Library in the iTunes source list.
    The same with iPhoto on a Mac. A photo cannot be in an in iPhoto Event or Album unless the photo is in the main iPhoto library. Placing a photo in an Event or Album does not duplicate the photo. This way you can view the photos in an iPhoto Event or Album only by selecting the Event or Album, or all photos in all Events or Albums.

  • I want to delete exchange email account from my iPhone 5s but when ever opening the setting-Mail,Contacts,Calenders but no option to delete the account, please help

    I want to delete exchange email account from my iPhone 5s but when ever opening the setting-Mail,Contacts,Calenders but no option to delete the account, please help

    Do you have Settings/General/Restrictions/Accounts set to dont allow changes - i have an exchange email account on my 6+ and there was a button at the bottom to delete the account
    i dont know that much about exchange ( i hate it) but im wondering if this might be some administrator setting on the account

  • I have a hp m175nw printer. the email prints from my iphone, but the picture does not

    m175nw printer. the email prints from my iphone, but the picture does not
    This question was solved.
    View Solution.

    If the DPI(dots per inch) is under 100, the printer will not print the picture because it would be too low in quality. Pull the picture up on the computer, right click on it and click on properties, Check out the horizontal and vertical DPI and see if both of those numbers are least 100. Have you tried to connect the iPhone to the same network as the printer and try to AirPrint the pic? The AirPrint route does not have the same DPI requirements as the ePrint .
    I am a former employee of HP...
    How do I give Kudos?| How do I mark a post as Solved?

  • How do you change the ordering of data in the iPhone Addressbook?

    I have noticed that when I manually enter contact information into the iphone addressbook I can control the order in which numbers appear. For example I like to have my phone numbers in the order, Work -> Home -> Mobile -> Fax. On the desktop addressbook client I have set it up this way, but when I sync to the iPhone the numbers seem to come into the contact in any number of orders, with no descernable pattern. Anyone know of a way to fix this other than modifying each contact by hand on the iPhone?
    Moving forward apple should configure the sync to honor the order the desktop Addressbook has them configured in.

    Super fast resolution per Tiffany of Apple Support (Thanks, Tiffany!) - it's a bug in the Slideshow Button featured at the bottom of Albums and Events windows. You will need to create an actual slideshow, as follows:
    Select the images you want to use --> chose "Add To" --> "Slideshow"--> "New" or chose an existing slideshow.
    You will be able to manipulate your slideshow options (theme, music, order, etc) from there.

  • Hello! Ever since I upgraded my iPhone 5s to IOS 7.1, I am unable to access the iPhone Keyboard if I access contacts the recent calls tab. I am also unable to access the keyboard if I want to search for a contact as long as I went through the recent calls

    Hello! Ever since I upgraded my iPhone 5s to IOS 7.1, I am unable to access the iPhone Keyboard if I access contacts using the recent calls tab. I am also unable to access the keyboard if I want to search for a contact as long as I went through the recent calls tab. Has anyone a fix for this problem? If you want to try it out, do the following?
    Dial a number from your iPhone Keypad. After cutting the call, try to save the number you just dialled to your contacts by choosing the new contact option. You will see that you will not be able to key in the name of your new contact.

    Works fine for me.
    Try a reset: Simultaneously hold down the Home and On buttons until the device shuts down. Ignore the off slider if it appears. Once shut down is complete, if it doesn't restart on it own, turn the device back on using the On button. In some cases it also helps to double click the Home button and close all apps BEFORE doing the reset.

  • I forget the lock code and now I can not access the iphone. What I can do?

    I forget the lock code and now I can not access the iphone. I try to restore it, but ask me to go to iphone settings to which I have no access and I can not download the latest version of iOS to do it.
    Thanks!

    If you have a passcode to the screen lock that you've forgotten, restore the device from the computer to which the device is synced. For information and instructions, see:
    http://support.apple.com/kb/ht1212
    If that will not work, you'll need to put the device into Recovery Mode and then try the Restore again:
    http://support.apple.com/kb/ht1808
    If that still doesn't work, as a last resort try DFU mode:
    http://www.iclarified.com/entry/index.php?enid=1034
    If your device is running iOS 7 and you set up Find My iPhone (iPad/iPod),  however, then it has the Activation Lock on it and you'll need to enter in your Apple ID and password to activate the device after restoring:
    http://support.apple.com/kb/HT5818
    Regards.
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Communities page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums and in the Apple Knowledge Base, before you post a question.

  • Two days ago, I have a new iphone 4S. After I installed the OS and start the iphone, I found a strange screen says "!9D/JC" that blocks the iphone and I can not access the iphone until click many times on the "Desmiss"  button at the botom of the screen.

    Two days ago, I have a new iphone 4S. After I installed the OS and start the iphone, I found a strange screen says "!9D/JC" that blocks the iphone and I can not access the iphone until click many times on the "Desmiss" button at the botom of the screen.
    I appreciate if you could provide me support to solve this problem especially it consumes the battery a lot.

    Another post originally dated 5th Feb, 2012 with a slightly different unheard of error "%7D/JC".
    https://discussions.apple.com/thread/3710903?start=0&tstart=0
    The user also claimed that he didn't meddle with iOS. No solution could be found though.

  • Tutorial on accessing the iPhones GPS location?

    Hi
    Is there any tutorials out there that would show me how to access the iPhones GPS location?  I've heard that it can be done but it didn't say anymore than that!
    Many Thanks in advance

    Hi Guys,
    Found the information I was looking for, if you are interested it is here: http://help.adobe.com/en_US/as3/dev/WS144092a96ffef7cc-66bf4d0212658dde8c4-7fff.html
    Oh and OMG! They have made it so simple! Thank you Adobe, you are my gods! *LOL* Is that a bit too much? *LMAO*
    Many Thanks for making such a kick arse system, I really look forward to what you will do with it in the future.

  • How do you delete an email address from your iPhone that's not in your contacts?

    How do you delete an email address from your iPhone that's not in your contacts?

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

  • TS3899 I have a problem with emails disappearing from my iphone. These are emails that I have put into folders to keep. When I go back to get them they are gone. Need help please.

    I have had issues with my iphone deleting emails without my consent. It seems as if it doesn't want to hold onto emails for an extended amount of time. I use my iphone for all work related emails and personal. I have created folders to store important emails in related to work. I found when I need to retrieve those emails, they simply are not there. I was told to delete the email account from my iphone, then to add it back into phone. I have done this and things seem fine, then after a few days it no longer works. I have researched this topic and see that I am not the only one with this problem. From what I can find no one seems to have the answer. Please help?

    Settings > Mail, Contacts, Calendars > Tap email account in question > nMail days to sync > extend the time

  • How can I remove email account from an iphone but leave it on another?

    Hi
    Can anyone advise me if I delete an email account from one iPhone will it still be available on another iPhone.  I've upgraded my phone but am giving my old iPhone to my husband but want to remove as many emails to save on memory for him, but when I delete from the old iPhone, the same emails are deleted from my new iPhone.
    I have seen that the account can be deleted, but don't want to delete it without knowing whether it will leave the account still on my new iPhone.
    Has anyone had experience of this, and can you advise me what I need to do?
    Many thanks
    A

    Hi
    Thanks for your reply.  I just didn't want to select "delete" without checking it out first...
    I'll give it a go later.
    A

  • How can I access my iTunes account from my iPhone.

    1- I can't access my iTunes account from my iPhone.
    Do I have to sync them or can I download the songs I bought without connecting with my macbook?
    Last time i connected the two, all my music got deleted. Must have done something wrong, but have no idea how to prevent that from happening again.
    2- My "preferences" panel in iTunes, only shows apps and books, not music- Why?
    3- I can't save any music on iClod.

    hello. 
    i followed your link on how to delete content from all things Apple, and nothing removes books, movies, music... it just gives said device(s) the iCloud/download icon on top of the book, movie...  not sure what the 'hide' purchase actually does - after X'ing/hide, everything STILL appears across all devices using that account.  could you clarify this any further?
    if i am understanding iTunes correctly, then EVERYTHING we download (free or purchased) will be FOREVER accessible with zero way for us to control what is filling up this mysterious vault called the cloud?  (creepy- apple is keeping EVERYTHING, what happens when the cloud gets full?)
    since we have iCloud.com and it shows our "stuff" that we iCloud sync from our devices such as notes, contacts, calendar... then why doesn't apple provide an iCloud.com tab that shows ALL of our purchases so we as CONSUMERS control/delete what is in our account? 
    we download ALOT of apps to try and then delete them off our devices.  that works fine, but movies and books are always there.  maybe a glitch?

Maybe you are looking for