• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problem with vCard and AddressBook ABPerson UID, HELP!!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with vCard and AddressBook ABPerson UID, HELP!!


  • Subject: Problem with vCard and AddressBook ABPerson UID, HELP!!
  • From: Eric Giguere <email@hidden>
  • Date: Wed, 07 Apr 2010 23:16:44 -0400

Hi all

I've been fighting now with the AdressBook API for a while and found a disturbing problem. Maybe someone can help.

I'm trying to use the AddressBook as my main person "database" in my application. I've create a small function that accepts drag - drops from the Address book to add a new person in my app. So far so good.

I'm trying after to show in my application details about that linked person and that's where everything falls down.

On drop, I read the vCard created by the AddressBook using this line:

ABPerson* aPerson = [[ABPerson alloc] initWithVCardRepresentation:filedata];

When doing this, the UID of my person gets re-generated. I wanted to use the UID as my reference to my original address book record and dig the information using it. But since its re-generated upon read of the vCard, no luck. So the call:
	ABAddressBook* addressBook = [ABAddressBook addressBook];
	ABRecord* abRecord = [addressBook recordForUniqueId:personId];

always return null.
But, if I use the sharedAddressBook instead, my UIDs still get re-generated but this guy (the sharedAddressBook) can find the records but only in the same execution of the application. Upon restart, same old no-match problem.

There must be something i REALLY don't understand about the AB but can't find anything more, out of ideas.

Anybody knows what's going on? Any way we can prevent my vCard initialization from re-genrating the UID? If not, then what would be the correct way to refer to AB records from another application? Running a search based on names sounds bad compared to using direct pointers to records, the UID.

Thank you !
Eric.


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Alternative Location of Cocoa ID3 Framework??
  • Next by Date: Re: How does Finder determine when a file is busy being written to the disk?
  • Previous by thread: Re: Reordered columns and [tableView editColumn:0 row:ind withEvent:nil select:YES];
  • Next by thread: re: Problem with vCard and AddressBook ABPerson UID, HELP!!
  • Index(es):
    • Date
    • Thread