2

I am using ABPeoplePickerNavigationController to allow the user to select an ABPerson from their address book. I import some data from that contact.

I would like to update a field in that ABPerson to indicate that I've already imported data from that ABPerson (I'm currently saving this in the Note field - is there any better way?)

But the object I get back from the SelectPerson event (ABPeoplePickerSelectPersonEventArgs.Person) is "detached" from the address book.

What I was hoping to do is something like:

        var book = new ABAddressBook();
        var p = book.GetPerson(e.Person.GetProperty(ABPersonProperty.ID));
        p.Note = "foo";
        book.Save();

But I can't find an appropriate property.

I read somewhere that there is a kABUIDProperty and was hoping that this is the int that GetPerson wants, but I can't find it on ABPerson.

Is there a way to do this?

Omri Gazitt
  • 3,428
  • 2
  • 21
  • 27

1 Answers1

3

This works fine for me:

    var book = new ABAddressBook();
    var p = book.GetPerson(e.Person.Id);
    p.Note = "TEST";
    book.Save();
Lars
  • 512
  • 1
  • 3
  • 13
  • Thanks Lars - that worked... embarrassing that I didn't find that property. I was looking on ABPerson but it is on the superclass (ABRecord). Duh. – Omri Gazitt May 23 '12 at 23:57